Re: [GD-DEVEL] Problem filling an image
| From: | Pierre Joye | Date: | Thu, 06 Nov 2008 20:54:20 +0000 |
| Subject: | Re: [GD-DEVEL] Problem filling an image | ||
| References: | 1 | Groups: | php.gd.devel |
| Request: | Send a blank email to php-gd-devel+get-502@lists.php.net to get a copy of this message | ||
hi!
On Thu, Nov 6, 2008 at 9:35 PM, Brian Peschel <brianp@occinc.com> wrote:
> I have some class that generates an image through GD. I new the class for
> each image I create and I create thousand of images in the life of the
> program. I have a problem where the background color is a random color if I
> set the background color to black (RGB 0,0,0). It works if I set it to just
> about anything else (grey RGB 190,190,190 or linen 250,240,230). The actual
> fill color is black on the first image I generate (in the lifetime), then it
> will go random. I have seen green, blue, red, purple, etc. I assume this
> is a problem with GD, as it works with every other color I have tried except
> black.
>
> Here is the code I am using.
> gdImagePtr _image;
> int _line_color;
> int style[20];
>
> _image = gdImageCreateTrueColor(xPixels, yPixels);
>
> // Allocate the first color
> gdImageColorAllocate(_image, backgroundColor.red(),
> backgroundColor.green(), backgroundColor.blue());
>
> // Fill the background
> _line_color = gdImageColorAllocate(_image, backgroundColor.red(),
> backgroundColor.green(), backgroundColor.blue());
> Any thoughts?
The code is not complete so hard to say. Where is define
backgroundColor? Which language do you use? c++?
Cheers,
--
Pierre
http://blog.thepimp.net | http://www.libgd.org