Home  >  Article  >  Backend Development  >  10行代码生成一个简单的图像,生成不了!该怎么处理

10行代码生成一个简单的图像,生成不了!该怎么处理

WBOY
WBOYOriginal
2016-06-13 13:52:23839browse

10行代码生成一个简单的图像,生成不了!
header( "Content-type:   image/png ");
$im=@imagecreate(100,100);
$background_color   =   imagecolorallocate($im,0,0,0);  
$text_color   =imagecolorallocate($im,255,255,255);  

imageline($im,1,1,350,25,$text_color);
imagearc($im,200,15,20,20,35,190,$background_color);
imagestring   ($im,   5,   5,   10,   "A   Simple   Text   String ",   $text_color);
imagepng   ($im);
imagedestroy   ($im);

------解决方案--------------------
装GD库没?
------解决方案--------------------
你的代码可以生成..没有问题
确认你的PHP配置文件extension=php_gd2.dll,这个已经打开....

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn