Create Color for paint in PHP

Description

The following code shows how to create Color for paint.

Example


<html>//from  w  ww  . j a  v  a  2 s.c om
<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,"test.png");
  ImageDestroy($img);
?>
<img src="pic.png" border=0>
</body>
</html>

The code above generates the following result.

Create Color for paint in PHP




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text