脚本宝典收集整理的这篇文章主要介绍了PHP – imagettftext无法正常工作并安装了GD,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
它看起来像是安装了GD
array(11) { ["GD Version"]=> string(27) "bundled (**2.0.34 compatible**)" ["FreeTyPE Support"]=> bool(false) ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPEG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["xpM Support"]=> bool(true) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }
上面你可以看到我的GD支持.
我的PHP版本是5.3,我在Linux上运行.
我尝试过来自不同网站的几个不同的代码示例,但都没有.
ImageString确实适合我,但我需要让imagettftext工作..
<?PHP ini_set('display_errors',1); error_reporting(E_ALL); // Set the content-type header('Content-Type: image/png'); // Create the image $im = imagecreatetruecolor(400,100) or die("Can't create image!"); // Create some colors $whITe = imagecolorallocate($im,255,255); $grey = imagecolorallocate($im,128,128); $black = imagecolorallocate($im,0); imagefilledrectangle($im,399,29,$white); // The text to draw $text = 'testing'; // Replace path by your own font path $font = 'arial.ttf'; // Add some shadow to the text imagettftext($im,20,11,21,$grey,'arial.ttf',$text); // Add the text imagettftext($im,10,$black,$text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?>
以上是脚本宝典为你收集整理的PHP – imagettftext无法正常工作并安装了GD全部内容,希望文章能够帮你解决PHP – imagettftext无法正常工作并安装了GD所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。