Probleme with imageColorAllocate function
| From: | pascal leboucher | Date: | Mon, 10 Jul 2000 15:03:32 +0000 |
| Subject: | Probleme with imageColorAllocate function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5732@lists.php.net to get a copy of this message | ||
Hi there,
I'm new in this list, so hello everyone.
I would like to know if somebody have already got
the following probleme with the imageColorAllocate
function:
I use it in a loop and the function return the right
color id but only in the beginning. After some loop
the function return always -1.
Here the code:
$colors = array (
"yellow" => array (255, 255, 0),
"blue" => array (51, 102, 153)
) ;
for ($j=0; $j<20; $j++)
{
...
list($red, $green, $blue) = $colors[$info[3]];
$i_color = imageColorAllocate($small_img_id, $red, $green, $blue) ;
...
}
info: $info[3] is switching between "yellow" and "blue".
If somebody knows why after one or two loop $i_color is
always equal to -1, I'm pretty interested by his solution !
Thanks
Pascal