Mega Code Archive

 
Categories / Php / Graphics
 

Applying TrueType Fonts to an Image

<?php     $animage = imagecreatefromjpeg ("myImage.jpg")){     $black = imagecolorallocate ($animage, 0, 0, 0);     $topleftx = 10;     $toplefty = 30;     $bottomrightx = 70;     $bottomrighty = 90;            $verdana = "C:\WINDOWS\Fonts\verdana.ttf";     $dimensions = imagettfbbox (14,0,$verdana, $_GET['whattosay']);     $strlen = 100;     $xcoord = 200;            imagettftext($animage, 14, 0, $xcoord, 60, $black, $verdana, $_GET['whattosay']);            imagejpeg ($animage);     header ("Content-type: image/jpeg");            imagedestroy ($animage); ?>