I thought this script would create a 256*256 pixel image, each one of a
random color:

______________________________

<?php
dl("php_gd.dll");

$im1 = imagecreate (257,257);

for ($i=0; $i<=256; $i++)  {
  for ($j=0; $j<=256; $j++)  {

     $color = ImageColorAllocate ($im1, rand(0,255), rand(0,255),
rand(0,255) ) ;
     imageline ($im1,  $i,$j, $i+1, $j+1 , $color);
     }
  }

$filename= "c:\\temp\\prova.jpg";
ImageJPEG ( $im1, $filename , 97);
imagedestroy ($im1);

echo "<img src='$filename'>";

?>
______________________________


but it seems you can't allocate more than 256 colors (though you get no
errors)..

could anybody try it on a linux box?
is this a bug or it's the normal behaviour?

thanks for any help,
bye,
Giuse
http://boltthrower.webhop.org




-- 
PHP Windows 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