Create Color for paint : Image Color « Graphics Image « PHP






Create Color for paint

<html>
<body>
<?php
  $img=ImageCreate(200,200);
                                          
  $bgcolor=ImageColorAllocate($img,200,200,200);
  $pixelcolor=ImagecolorAllocate($img,255,0,0); 
                                        
  ImageSetPixel($img,50,50,$pixelcolor);
  ImagePNG($img,"pic.png");
  ImageDestroy($img);
?>
<img src="pic.png" border=0>
</body>
</html>
           
       








Related examples in the same category

1.Color: red, green and blue
2.Writing a String with imageTTFtext()