有時imagecolorat()會返回0,並在我要分析的PNG中顯示一些像素。這是爲什麼?php imagecolorat returns 0.爲什麼?
我看了像素,顏色真的是#111111。所以它應該返回1118481.對嗎?
我嘗試使用imagealphablending($ IMG,真正的),但我仍然得到0
謝謝!
$img = @imagecreatefrompng($png);
if(!$img){
throw new Exception("Error loading PNG.");
}
var_dump(imagecolorat($img, 37, 625));
結果:
int 0
你能給我們一些代碼嗎? –
@Ninsuo我加了一部分代碼。 –