Here is something weird going on.  Why is it that imagecolorallocate dies
after 256 colors have been allocated?  Note, this doesn't matter if
you write a jpg or png, it all produces the same result (see attached
graphic).

Yes, the colors are randomly made, and they all go in a straight, diagonal
line (315 degrees to be precise), and on the 256'th pixel
(I HAVE COUNTED EVERY PIXEL TO MAKE SURE)
it gets stuck on the last color and then continues painting pixels at that
last color until the end of the line.

I've tried to use imagecolordeallocate right after the pixel is drawn,
but that only makes all the pixels come out in one color (white).

Its like the "palette" only holds 256 pixels or something, what's
the deal with that?

Anyone experienced this before?  I've looked through the GD library
documentation
at boutell.com, i've looked through php.net, and every search engine on the
internet, and I can't seem to find out what is going on.

Thanks
Dan

======================================================================
<?
$im = imagecreate(400,400);

//sets background to black
imagecolorallocate($im,0,0,0);

$x=0;
$y=0;

while ($x <=400 ){
$color=imagecolorallocate($im,rand(0,255),rand(0,255),rand(0,255));
imagesetpixel($im,$x,$y,$color);
++$x;
++$y;
}

header("Content-type: image/png");
Imagepng($im);
ImageDestroy($im);
?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to