Newbie transparent gif question

[email protected] (Roger Oberholtzer) Mon, 28 Apr 2008 09:59:51 +0200
Newsgroups php.gd.devel
Message-ID <[email protected]>
I am trying to create transparent gifs via gd 2.0.32 on openSUSE Linux.
Nothing fancy. I set the entire image to the transparent color, and then
draw on top. I only see the color I defined, not a transparent image. My
viewer does support transparent gifs. I test viewed one just to be sure
(konqueror in kde 3). Transparent gifs have the transparent part shown
as a checker board.

Code snippet:

gdImagePtr imBase = gdImageCreate(100,100);
int grey = gdImageColorAllocate(imBase, 200, 200, 200);
gdImageColorTransparent(imBase, grey);
gdImageFilledRectangle(imBase,  0, 0, 100,100, grey);

Then I draw some lines or things on top in colors other than grey. Then
I save the image. But the grey is shown as, well, grey. Not
transparent. 

What obvious thing have I missed?

-- 
Roger Oberholtzer

OPQ Systems / Ramböll RST

Ramböll Sverige AB
Kapellgränd 7
P.O. Box 4205
SE-102 65 Stockholm, Sweden

Office: Int +46 8-615 60 20
Mobile: Int +46 70-815 1696