我用的是集成软件XAMPP,代码应该是没有问题的,因为把直接输出的语句改成保存在服务器上是可以看到生成的图片的,但还是把代码贴出来吧:
<?php
//header("Location: test.php");
// create a blank image
$image = imagecreatetruecolor(400, 300); // fill the background color
$bg = imagecolorallocate($image, 0, 0, 0); // choose a color for the polygon
$col_poly = imagecolorallocate($image, 255, 255, 255); // draw the polygon
imagepolygon($image,array (
0, 0,
100, 200,
300, 200
),
3,
$col_poly
); // output the picture
header("Content-Type:image/png");
imagepng($image);
        //imagepng($image,"one.png");
imagedestroy($image);
 
求高手们帮我看看,折腾我好久了,不吝赐教,万分感谢!!!!!!!