把html语句去掉。改成这样:
<?php
header ("Content-type: image/png");
$im = @imagecreate (50, 100)
or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagestring ($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng ($im);
imagedestroy ($im);
?>
<?php
header ("Content-type: image/png");
$im = @imagecreate (50, 100)
or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagestring ($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng ($im);
imagedestroy ($im);
?>
<?php
header ("Content-type: image/png");
$im = @imagecreate (50, 100)
or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagestring ($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng ($im);
imagedestroy ($im);
?>
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library
JPG Support enabled
PNG Support enabled
WBMP Support enabled
我的gd扩展库应该是没问题,但是还是看不见
draw.php
<?php
header ("Content-type: image/png");
$im = @imagecreate (50, 100)
or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagestring ($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng ($im);
imagedestroy ($im);
?>draw.html
<html>
<head>
</head>
<body>
<?php
echo "<img src='draw.php' > "
?>
</body>
</html>
Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdocs\myphp\draw.php:1) in c:\apache\htdocs\myphp\draw.php on line 2
?PNG IHDR2d?PLTE?[?˝?<IDATx?c` 03<b?,?@ ?ٲ[؛??l򛔂[?ď?񕀵0?jǨ?퉊;?ؕ瀀IEND?B`?
到底怎么回事?!