
 Arjumand Younus - 2007-10-18 13:38:52 - 
In reply to message 2 from Steffen MuellerI am using GD2 which comes with Easy-PHP 1.8.I am reading a bitmap pixel by pixel and displaying it on the browser window.For bitmaps that have 256 colors or less it is working fine but as soon as I reach the 257th color that 257th color is not displayed properly rather it is some approximaetd value.
Check out the following code.......the first should be a series of blue lines and second should be series of green lines.
<?php
//draw1.php
Header("Content-type: image/jpeg");
$image = ImageCreate(500,400);
$gray = ImageColorAllocate($image,204,204,204);
for($i=0;$i<=255;$i++)
      {
	$blue = ImageColorAllocate($image,0,0,$i);
        ImageLine($image,0,$i*2,150,$i*2,$blue);
       }
for($j=0;$j<=255;$j++)
      {
	$green = ImageColorAllocate($image,$j,0,0);
        ImageLine($image,175,$j*2,350,$j*2,$green);
       }
ImageJPEG($image);
ImageDestroy($image);
?>
Hence the question is not nonsense...........tell me how to resolve this problem.