小编Joh*_*ake的帖子

旋转PNG,然后使用图像透明度重新保存

我在一个正在轮换的PNG上获得PNG透明度方面遇到了一些重大问题.

$filename = 'bird_up.png';
$source = imagecreatefrompng($filename) or die('Error opening file '.$filename);
imagealphablending($source, false);
imagesavealpha($source, true);
$rotation = imagerotate($source, $degrees, imageColorAllocateAlpha($source, 0, 0, 0, 127));
imagealphablending($source, false);
imagesavealpha($source, true);
header('Content-type: image/png');
imagepng($rotation);
imagedestroy($source);
imagedestroy($rotation);
Run Code Online (Sandbox Code Playgroud)

php png alpha rotation transparent

4
推荐指数
1
解决办法
5217
查看次数

标签 统计

alpha ×1

php ×1

png ×1

rotation ×1

transparent ×1