once refer these links:
http://www.rafaeldohms.com.br/2008/02/12/adding-text-to-images-in-real-time-with-php/en/
http://www.developertutorials.com/tutorials/php/adding-custom-text-to-image-050620/page1.html
or try this:
<?php
$image = ImageCreateFromPNG("base.png");
$color = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$colorShadow = imagecolorallocate($image, 0x66, 0x66, 0x66);
$font = 'arial.ttf';
$fontSize = "10";
$fontRotation = "0";
$str = "Example of GD in PHP. Date: " . date("m-j-Y g:i:s (a)");
/* Shadow */
ImageTTFText($image, $fontSize, $fontRotation, 7, 22, $colorShadow, $font, $str);
/* Top Level */
ImageTTFText($image, $fontSize, $fontRotation, 5, 20, $color, $font, $str);
header("Content-Type: image/PNG");
ImagePng ($image);
imagedestroy($image);
?>
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162