$tileImg = imagecreatefrompng($srcImagePath);
imagealphablending($tileImg,true);
imagecolortransparent($tileImg, imagecolorallocatealpha($tileImg, 255, 255, 255, 0));
imagecopymerge($mapImage, $tileImg, $x, $y,0, 0, $tileWidth, $tileHeight,100);
imagedestroy($tileImg);
$bgColor = imagecolorallocate($mapImage, 255, 255, 255);
imagefill($mapImage, 0, 0, $bgColor);
我正在尝试获得透明图像,但不知何故背景以黑色出现......
请帮忙。