【发布时间】:2011-05-08 16:08:42
【问题描述】:
我昨天一整天都在尝试解决这个问题。我通过 imagerotate() 旋转图像。我得到一个黑色背景,图像不再覆盖。我已经尝试了所有我想不到的方法来使背景透明..
这是我当前的代码..
function rotate($degrees) {
$image = $this->image;
imagealphablending($image, false);
$color = imagecolorallocatealpha($image, 0, 0, 0, 127);
$rotate = imagerotate($image, $degrees, $color);
imagecolortransparent($rotate, $color);
imagesavealpha($image, true);
$this->image = $rotate;
}
我真的开始被打勾了。有人可以给我看一些工作代码吗?请问?
我的 WAMP 服务器和 Dreamweaver 有问题吗?因为我什至试过这个..http://www.exorithm.com/algorithm/view/rotate_image_alpha 它仍然会显示黑色或白色背景..
【问题讨论】:
-
似乎与昨天的问题重复。 stackoverflow.com/questions/4148774/…
-
是的。我知道我真的不应该再发帖了,但你不知道我多么希望这段代码能够正常工作..
-
请指定您的 PHP 版本。
标签: php png transparency gd