For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > February 2005 > resize transparent gif images









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author resize transparent gif images
anton

2005-02-28, 3:56 pm

Hi,

I have some truble resizing a transparent gif image.
After a while inside php.net trying diferent sollutions, I managed to
resize a gif and make this
transparent. But here I substituted white with transparent.
I need to resize a transparent gif. Any tryout on this results in
black instead of transparent.
Her is the code I used to resize and substitute the white with
transparent.

$dest = ImageCreateTrueColor(200,300);
imagetruecolortopalette($dest, false, 256);
@imagecopyresized ($dest, $src, 0, 0, 0, 0, 200, 300, 500,600);
$white = imagecolorresolve($this->img["des"], 255, 255, 255);
$transparent = imagecolortransparent($this->img["des"], $white);
echo "transp = $transparent<br>";
imagegif($dest,"test.gif");

Since the tryout with the transparent image resulted in black i tried
to substitute in
this line: $white = imagecolorresolve($this->img["des"], 0,0, 0);
But still black!

what do I miss?

regards, Sindre
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com