昨天我整天试着试图解决这个问题.我通过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;
}
Run Code Online (Sandbox Code Playgroud)
我真的开始被勾掉了.有人能告诉我一些工作代码吗?请?
我的WAMP服务器和Dreamweaver可能有问题吗?因为我甚至试过这个.. http://www.exorithm.com/algorithm/view/rotate_image_alpha,它仍然可以输出黑色或白色背景..
我有这个代码
<script type="text/javascript">
$("#main_photo_display").load(function(){
alert("loaded");
});
</script>
<div id="main_photo_display"></div>
Run Code Online (Sandbox Code Playgroud)
一旦div加载,我需要它做一些事情.目前它什么都不做.当我用"#main_photo_display"代替窗口时,它可以工作.我已经google了,我不断遇到.load如何检查是否已加载页面元素.