Points and Lines : imagesetpixel « Graphics Image « PHP






Points and Lines

 
<?php
    $width = 255;
    $height = 255;
    $image = imagecreatetruecolor($width, $height);

    for ($i = 0; $i <= $width; ++$i) {
            for ($j = 0; $j <= $height; ++$j) {
                    $col = imagecolorallocate($image, 255, $i, $j);
                    imagesetpixel($image, $i, $j, $col);
            }
    }

    header("Content-type: image/png");
    imagepng($image);
    imagedestroy($image);
?>
  
  








Related examples in the same category