Paint string value with different colors and position : Draw String : Graphics Image PHP Source Code


PHP Source Code » Graphics Image » Draw String »

 

Paint string value with different colors and position




<html>
<body>
<?php
   $img=ImageCreate(300,300);

   $bgcolor=ImageColorAllocate($img,200,200,200);
   $red=ImagecolorAllocate($img,255,0,0)
   $green=ImagecolorAllocate($img,0,255,0)
   $blue=ImagecolorAllocate($img,0,0,255)
   $grey=ImagecolorAllocate($img,50,50,50)
   $black=ImagecolorAllocate($img,0,0,0)
                                                            
                                                            
   ImageString($img,0,20,20,"www.navioo.com",$red);
   ImageString($img,1,20,40,"www.navioo.com",$green);
   ImageString($img,2,20,60,"www.navioo.com",$blue);
   ImageString($img,3,20,80,"www.navioo.com",$grey);
   ImageString($img,4,20,100,"www.navioo.com",$black);
   ImageString($img,5,20,120,"www.navioo.com",$red);
                                                            
   ImageStringUp($img,0,50,200,"www.navioo.com",$red);
   ImageStringUp($img,1,100,200,"www.navioo.com",$green);
   ImageStringUp($img,2,150,200,"www.navioo.com",$blue);
   ImageStringUp($img,3,200,200,"www.navioo.com",$grey);
   ImageStringUp($img,4,250,200,"www.navioo.com",$black);
   ImageStringUp($img,5,300,200,"www.navioo.com",$red);
                                                            
   ImageSetPixel($img,50,50,$pixelcolor);
   ImagePNG($img,"pic.png");
   ImageDestroy($img);
?>
<img src="pic.png" border=0>
</body>
</html>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Graphics Image
» Draw String