Hi there,

I am having a problem in ImageColorAllocate function. I am using this
function in a loop. After some number of looping the function starts
returning -1 value. I am attaching my code below. Can any one help me with
this?

<?php

header("Content-type: image/png");

// create a 100*30 image
$im = imagecreate(300, 300);

// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);

$j=0;
 for($i=1;$i<=30;$i++)
 {
     $textcolor = imagecolorallocatealpha($im, $i*2, $i*3, $j, 0);

     // write the string at the top left
     imagestring($im, 5, 0, $j, "Hello world!", $textcolor);
     //imagecolordeallocate($im,$textcolor);
     $j=$j+10;
}

// output the image
imagepng($im,"try.png");

?>

Thanks for reading this far.

Kevin.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to