0
我正在使用PHP-GD.When当我尝试在PHP中使用“imagecreatetruecolor”函数创建图像时,会生成图像。但是,这里产生的主要问题是如此生成的图像具有代码中指定的黑色背景,但整个页面的其余部分也变成灰色,并且图像显示在窗口的中心,而不管imagecreatetruecolor函数中给出的属性。自PHP-GD四个月以来一直工作,它从来没有发生过我。但形成上周它的行为尴尬。请帮我解决。php gd正在返回黑色背景和图像创建器函数返回页面中心的图像
<?php
header("Content-type: image/png");
$img = imagecreatetruecolor(400, 400);
$white = imagecolorallocate($img, 255, 255, 255);
$red = imagecolorallocate($img, 255, 0, 0);
$green = imagecolorallocate($img, 0, 255, 0);
$blue = imagecolorallocate($img, 0, 0, 255);
imagefilledellipse($img,100,100,10,10,$green);
imagefilledellipse($img,200,200,10,10,$green);
imagepng($img);
imagedestroy($img);
?>
广东话我们解决这个??我面临的问题是我不能理解图像大小,当我尝试保存图像时,它以php文件格式保存。 – Anvesh
感谢您回答@niraj shah。它像以前一样在Internet Explorer中工作,您提供的有关Chrome的答案可以帮助我。 – Anvesh