PHP绘图后无法在浏览器中正确显示问题
VBToy 2005-07-11 09:27:09 <?
$im=ImageCreate(300,200) or die("cannot create image");
$black=ImageColorAllocate($im,0,0,0);
$white=ImageColorAllocate($im,255,255,255);
Imagefill($im,0,0,$white);
ImageString($im,5,4,10,"Graphic test",$black);
Header ("Content-type:image/jpeg");
imagejpeg($im);
imagedestroy($im);
?>
上面一段代码在浏览器中无法显示图片,但的确有二进制数据传到浏览器中。如果用imagejpeg($im,本地文件名)的方式可以正确地在服务器上保存图片文件。问题出在哪里?
环境:Apache/1.3.29 (Win32)+ PHP/4.3.6+XP;