Thursday 28 May 2009

Merging String with the image in php


header("Content-type: image/jpeg");
$string = "jothirajafgjhvdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsgdsdsg
sdgdsgdsgdsgdsg";
$im = imagecreatefromjpeg("butterfly.jpg");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 40.5 * strlen($string)) / 100;
imagestring($im, 3, $px, 380, $string, $orange);
imagejpeg($im);
$jothirajan_a= "IMAGE_".date('d').time().".jpg";
imagejpeg ($im,"image/".$jothirajan_a."");
imagedestroy($im);
?>

No comments:

Post a Comment