PHP文字生成图片
PHP语言: PHP文字生成图片
<img src=”wordToImg.php?word=’中国’”>
所用到的wordToImg.php文件代码:
PHP语言: PHP文字生成图片
<?php
$ment = $_GET['word'];
$im = imagecreate(450,50);
$white = imagecolorallocate($im,56,180,218); //调整合适,达到消除锯齿效果
imagecolortransparent($im,$white);
$black = imagecolorallocate($im,255, 255,255);
imagettftext($im,26,0,0,40,$black,“C:\windows\Fonts\FZDHTJW.ttf”,$ment); //字体路径
header(“Content-type:image/png”);
imagepng($im);
?>
相关文章: $ment = $_GET['word'];
$im = imagecreate(450,50);
$white = imagecolorallocate($im,56,180,218); //调整合适,达到消除锯齿效果
imagecolortransparent($im,$white);
$black = imagecolorallocate($im,255, 255,255);
imagettftext($im,26,0,0,40,$black,“C:\windows\Fonts\FZDHTJW.ttf”,$ment); //字体路径
header(“Content-type:image/png”);
imagepng($im);
?>
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

学习了。