你好,我把图像显示成对象后几乎没有问题.我还在学习使用对象图像.所以这是我的代码:
$what = getimagesize($file);
switch(strtolower($what['mime'])){
case 'image/png' : $src_id = imagecreatefrompng($file); imagesavealpha($src_id,true) ; break;
case 'image/jpeg': $src_id = imagecreatefromjpeg($file); break;
case 'image/gif' : $old_id = imagecreatefromgif($file); $src_id = imagecreatetruecolor($what[0],$what[1]); imagecopy($src_id,$old_id,0,0,0,0,$what[0],$what[1]); break;
default: die();
}
header('Content-Type: image/jpeg');
imagejpeg($scr_id);
imagedestroy($scr_id);
die();
Run Code Online (Sandbox Code Playgroud)
浏览器输出带有文本"图像"的空白图像.在$ file上我给出文件URL.有任何想法吗 ?
我想用jquery动画函数设置背景颜色,我需要从数组中选择一个随机元素.
$(".menu li").hover(function() {
$(this).animate({borderBottomColor:"#81C6DD"}, 200)
}, function() {
$(this).animate({borderBottomColor:"#D8D9DC"}, 200)
});
Run Code Online (Sandbox Code Playgroud)