青菜猫(孙宇博客),青菜猫(孙宇博客),青菜猫(孙宇博客)http://www.javasdc.cn/
posts - 29,  comments - 63,  trackbacks - 0


   1,JS处理.(火狐不支持),是通过图片的style.filter来控制.
   具体代码
<html>
<head>
<title> </title>
<script type="text/javascript">
function rotateImage() {
imageToRotate = document.getElementById('imgRotate');          
imageToRotate.style.filter= "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')";
rotate()
}
var imageToRotate;
//定义旋转度数,图片太大,建义不要用
var degreeToRotate=360;
function rotate(){
var deg2radians = Math.PI * 2 / 360;
degreeToRotate++;
degreeToRotate=degreeToRotate%360;                 
rad = degreeToRotate * deg2radians ;
costheta = Math.cos(rad);
sintheta = Math.sin(rad);
imageToRotate.filters.item(0).M11 = costheta;
imageToRotate.filters.item(0).M12 = -sintheta;
imageToRotate.filters.item(0).M21 = sintheta;
imageToRotate.filters.item(0).M22 = costheta;
}
</script>
</head>
<body onload="rotateImage();">
<br /> 
<img id="imgRotate" src="test.JPG" />
</body>
</html>
2.也是JS处理
http://www.walterzorn.com/rotate_img/rotate_img.htm?A=90可以看看这个,外国做的,可以在火狐用,但是图片过大也不行,JS会变慢.
大家可以参考一下,
3.已经在服务器已经生成了,只需要调用了,我在项目是用的Jmagick(功能很强大,有生成的缩略图.加水印,旋转....)
下篇文章介绍.
                                                                                                                                                                                                                                            青菜猫

posted on 2008-04-08 22:51 青菜猫(孙宇) 阅读(635) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
<2008年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

青菜猫(孙宇)结交天下朋友,在网上吸取知识..

常用链接

留言簿(16)

随笔分类

随笔档案

文章分类

搜索

  •  

最新评论

阅读排行榜

评论排行榜

青菜猫(孙宇博客),青菜猫(孙宇博客),青菜猫(孙宇博客)http://www.javasdc.cn/