imagecolortransparent

From: Date: Wed, 18 Oct 2000 05:30:14 +0000
Subject: imagecolortransparent
Groups: php.general 
Request: Send a blank email to php-general+get-20794@lists.php.net to get a copy of this message
I'm trying the following code in a WinNT/Apache/PHP4.03 platform and am getting application errors popping up on the WinNT server. Now, perhaps my understanding of transparencies isn't deep enough to realize the error I've made, but would it happen to be my selected file format that I used? Here's my code: *In Main HTML file* <html> <body> <img src="test.php"> </body> </html> * In Test.php* <? $im = ImageCreateFromPng("test.png"); if (!$im){ echo "<b>Not working.</b><br>\n"; } else{ $black = ImageColorAllocate($im,0,0,0); $im = ImageColorTransparent($im,$black); $trans = ImageInterlace($im,1); header("Content-Type: Image/PNG"); ImagePNG($trans); ImageDestroy($trans); ImageDestroy($im); } ?> In the manual, the ImageColorTransparent didn't specify any particular format that it can be used with, so I assumed I can use this function with PNG files. Any help appreciated..

« previous php.general (#20794) next »