我使用imagefill()來更改背景顏色(如果是image.But),但同時這樣做的其他區域不受影響,將其顏色更改爲黑色。imagefill()將該區域的其餘區域變爲黑色
$image = imagecreatefrompng("sample.png");
$background = imagecolorallocate($image, 255, 0,0);
imagefill($image, 0,0, $background);
header("content-type: image/png");
imagepng($image,"sample.png");
這是我的code.Can任何人都可以告訴我這是怎麼發生的?
偉大的!它的工作..謝謝。 –