Create a php text file to generate an image. Php text to create and generate images now many people need to generate text images. Php gd Library allows us to do this. Here we provide a simple method, which is to create an image from the php text file of the image network.
Many people need to generate text images. Php gd Library allows us to do this. Here we provide a simple method, that is, the email address used on the image webpage. Some say this helps keep the email harvester far away, but its optical character recognition is still possible.
// Show the correct header for the image type
Header ("Content-type: image/jpg ");
// An email address in a string
$ String = "email@example.com ";
// Some variables to set
$ Font = 4;
$ Width = ImageFontWidth ($ font) * strlen ($ string );
$ Height = ImageFontHeight ($ font );
// Lets begin by creating an image
$ Im = @ imagecreatetruecolor ($ width, $ height );
// White background
$ Background_color = imagecolorallocate ($ instant, 255,255,255 );
// Black text
$ Text_color = imagecolorallocate ($ im, 0, 0, 0 );
// Put it all together
Imagestring ($ im, $ font, 0, 0, $ string, $ text_color );
// And display
Imagejpeg ($ im );
?>
Http://www.bkjia.com/PHPjc/444985.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/444985.htmlTechArticlephp text creation to generate images now many people want to generate text images. Php gd Library allows us to do this. Here we will give a simple method, which is to put the image network...