[英]How to avoid black background when rotating an image 45 degree using PHP?
[英]Black background when rotating image with PHP
我正在尝试使用 PHP 旋转 PNG 图像。 图像旋转但出现黑色背景。
这是我的代码:
$image = $_GET['image'];
$degrees = $_GET['degrees'];
header('Content-type: image/png');
$source = imagecreatefrompng($image) ;
$rotate = imagerotate($source, $degrees, 0);
imagesavealpha($rotate, TRUE);
imagepng($rotate);
return rotate;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.