Mega Code Archive

 
Categories / Php / Graphics
 

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