Home  |  Linux  | Mysql  | PHP  | XML
From:Pierre Joye Date:Fri May  2 05:49:40 2008
Subject:Re: [GD-DEVEL] Newbie transparent gif question- possibly solved.
On Fri, May 2, 2008 at 1:28 PM, Roger Oberholtzer <roger@opq.se> wrote:
> On Fri, 2008-05-02 at 12:26 +0200, Roger Oberholtzer wrote:
>  > Hello
>  >
>  > I know, bad form to follow one's own post. I have more info, but no
>  > solution.
>
>  And here I go again.
>
>  I think that I wind up with the color I want to be transparent being
>  defined more than once in the color map. Due to the way my code is
>  written, it could wind up setting the transparent color to a later
>  duplicate instance of the desired transparent color. Then it is no
>  longer going to be transparent. If I ensure that the transparent color
>  is defined as the first one, AND that I only set the transparent color
>  to this index (0), then all is ok. I think that my code wound up setting
>  the transparent color to the correct color, but the color was a
>  duplicate at some place other than 0 in the color map.
>
>  IMHO, the function gdImageColorTransparent is not fully correct, at
>  least when making a GIF. The second argument seems to need to be 0.
>  Anything else results in loff of transparency.

That's not correct. It works as expected by using a color index (not a
color value!) for palette images and a color value for true color
images.

I don't have the time now to give you a small examples but it does
work as expected. You can take a look in the examples or tests
directories, a couple of them use the transparent color.

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org
Navigate in group php.gd.devel at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants