Re: [GD-DEVEL] Newbie transparent gif question- possibly solved.
| From: | Roger Oberholtzer | Date: | Fri, 02 May 2008 18:23:33 +0000 |
| Subject: | Re: [GD-DEVEL] Newbie transparent gif question- possibly solved. | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.gd.devel |
| Request: | Send a blank email to php-gd-devel+get-428@lists.php.net to get a copy of this message | ||
On Fri, 2008-05-02 at 14:57 +0200, Pierre Joye wrote:
> On Fri, May 2, 2008 at 2:31 PM, Roger Oberholtzer <roger@opq.se> wrote:
>
> > Thanks! Be sure to do one where you Allocate a color more than once, and
> > set the transparency to one after the first Allocate of the color.
>
>
> Do you understand what I mean by:
>
> It uses only the color index with palette images.
I do indeed understand the concept. All I can say is that something
makes this not work as expected. I suspect it is that I am using the
code in a way other that you expect. But, from what I can tell, not in
contradiction to the documentation.
What would happen if I read in the image again into GD? Does the index
get set properly upon read?
I will see if I can pare down my code into the minimal that makes this
happen. Or not happen, as the case may be.
>
> ?
>
>
> im = gdImageCreate(100,100);
> for (i=0; I<256;i++) {
> a[i] = gdImageColorAllocate(im, 255,0,0);
> }
>
> gdImageColorTransparent(im, 23);
>
> That will tell GD to use the index number 23 as transparent color. The
> index is what is stored in the image, and not the color values. It
> does not matter if the 254 other indexes have the exact same value.
>
> Cheers,
> --
> Pierre
> http://blog.thepimp.net |
> http://www.libgd.org
>
--
Roger Oberholtzer
OPQ Systems / Ramböll RST
Ramböll Sverige AB
Kapellgränd 7
P.O. Box 4205
SE-102 65 Stockholm, Sweden
Tel: Int +46 8-615 60 20
Fax: Int +46 8-31 42 23