asmith Posted February 27, 2009 Share Posted February 27, 2009 Hi, I use something like this to generate a transparent image which works in FF : header("Content-Type: image/png"); // create the image resource $image = imagecreatetruecolor(300, 70); imagesavealpha($image, true); $trans_colour = imagecolorallocatealpha($image, 0, 0, 0, 127); imagefill($image, 0, 0, $trans_colour); then I draw what I want in there, with colors and imagettftext() mostly. at the end : imagepng($image); imagedestroy($image); all works fine in FF. but IE6 shows a gray background instead. how can I tune it for IE6? Is it a way a make the background transparent with GIF image? I guess IE won't miss gif transparents. Quote Link to comment https://forums.phpfreaks.com/topic/147206-make-image-background-transparent-for-msie6/ Share on other sites More sharing options...
asmith Posted March 6, 2009 Author Share Posted March 6, 2009 *bump* even imagecolortransparent in php sites show the image non transparent when it is opened by IE6 browser. Quote Link to comment https://forums.phpfreaks.com/topic/147206-make-image-background-transparent-for-msie6/#findComment-778099 Share on other sites More sharing options...
DjMikeS Posted March 6, 2009 Share Posted March 6, 2009 That is because IE6 just doesn't support a transparent background for png... I don't know about gif... Quote Link to comment https://forums.phpfreaks.com/topic/147206-make-image-background-transparent-for-msie6/#findComment-778122 Share on other sites More sharing options...
kickstart Posted March 6, 2009 Share Posted March 6, 2009 Hi IE6 does support transparent GIF images, but they have other issues (they don't fade as nicely). All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/147206-make-image-background-transparent-for-msie6/#findComment-778127 Share on other sites More sharing options...
Boo-urns Posted March 6, 2009 Share Posted March 6, 2009 Wouldn't using a IE6 png fix, fix the problem here? I forget which one I use as I'm at work, but just google "easy ie6 png fix" and try a few. I really don't recall which one i use when I google it but the one I've found to be the best is when you include a javascript file at the bottom of the page. Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/147206-make-image-background-transparent-for-msie6/#findComment-778227 Share on other sites More sharing options...
asmith Posted March 6, 2009 Author Share Posted March 6, 2009 How do you make GIF transparent with PHP? Quote Link to comment https://forums.phpfreaks.com/topic/147206-make-image-background-transparent-for-msie6/#findComment-778511 Share on other sites More sharing options...
redarrow Posted March 6, 2009 Share Posted March 6, 2009 <?php // Create a 55x30 image $im = imagecreatetruecolor(55, 30); $red = imagecolorallocate($im, 255, 0, 0); $black = imagecolorallocate($im, 0, 0, 0); // Make the background transparent imagecolortransparent($im, $black); // Draw a red rectangle imagefilledrectangle($im, 4, 4, 50, 25, $red); // Save the image imagepng($im, './imagecolortransparent.png'); imagedestroy($im); ?> url. http://uk.php.net/manual/en/function.imagecolortransparent.php Quote Link to comment https://forums.phpfreaks.com/topic/147206-make-image-background-transparent-for-msie6/#findComment-778523 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.