PHP用GD画图的怪问题。
nbabn 2004-08-03 08:33:43 Apache2.0.47(win32)+PHP5.0
代码如下:
PHP代码
d.php
<?php
class Pic
{
var $iamge;
function Pic()
{
header ("Content-type: image/png");
$this->image = imagecreatetruecolor(200,500);
$bgcolor = imagecolorallocate($this->image,255,255,255);
imagefill($this->image,0,0,$bgcolor);
imagettftext($this->image,18,0,12,18,0,"simsun.ttc",$_POST["T1"]);
imagepng($this->image);
}
}
$tmp = new Pic();
?>
HTML文件s.html
<html>
<head>
<title>输入</title>
</head>
<body>
<form method="POST" action="d.php">
输入 <input type="text" name="T1" size="20"><br>
<input type="submit" value="提交" name="B1">
<input type="reset" value="全部重写" name="B2">
</form>
</body>
</html>
从s.html提交过去的字符能画出来,浏览正常,但是在用IE打印预览的时候怪事来了,一片空白,为什么浏览能看见字符,打印预览就看不见了?