青菜貓(孫宇博客),青菜貓(孫宇博客),青菜貓(孫宇博客)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 青菜貓(孫宇) 閱讀(660) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2008年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          青菜貓(孫宇)結交天下朋友,在網上吸取知識..

          常用鏈接

          留言簿(16)

          隨筆分類

          隨筆檔案

          文章分類

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          青菜貓(孫宇博客),青菜貓(孫宇博客),青菜貓(孫宇博客)http://www.javasdc.cn/
          主站蜘蛛池模板: 江达县| 思南县| 伊通| 滕州市| 闻喜县| 白河县| 濮阳县| 张家川| 东宁县| 郸城县| 当阳市| 宕昌县| 行唐县| 高阳县| 南康市| 休宁县| 海林市| 河津市| 民丰县| 平武县| 永修县| 偏关县| 班玛县| 涪陵区| 嵊州市| 砀山县| 衡水市| 铜梁县| 长治市| 策勒县| 新郑市| 静海县| 宁乡县| 民乐县| 宝山区| 桂平市| 浦北县| 牟定县| 贡觉县| 伊通| 东光县|