假如有下面的代码:
<?php
header("Content-type: image/png");
$imgWidth=250;
$imgHeight=250;
$image=imagecreate($imgWidth, $imgHeight);
$colorWhite=imagecolorallocate($image, 255, 255, 255);
$colorGrey=imagecolorallocate($image, 192, 192, 192);
imageline($image, 0, 0, 0, 250, $colorGrey);
imageline($image, 0, 249, 249, 249, $colorGrey);
imagepng($image);
imagedestroy($image);
?>
生成一个坐标图,我想在坐标图的下面加上一句说明,于是我将上面的代码修改为:
<?php
header("Content-type: image/png");
$imgWidth=250;
$imgHeight=250;
$image=imagecreate($imgWidth, $imgHeight);
$colorWhite=imagecolorallocate($image, 255, 255, 255);
$colorGrey=imagecolorallocate($image, 192, 192, 192);
imageline($image, 0, 0, 0, 250, $colorGrey);
imageline($image, 0, 249, 249, 249, $colorGrey);
echo"这是坐标!";
imagepng($image);
imagedestroy($image);
?>
但运行完后,发现变成了乱码??
有哪位能帮忙解决一下,,谢谢...... |