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

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


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

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

          常用鏈接

          留言簿(16)

          隨筆分類

          隨筆檔案

          文章分類

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          青菜貓(孫宇博客),青菜貓(孫宇博客),青菜貓(孫宇博客)http://www.javasdc.cn/
          主站蜘蛛池模板: 宁武县| 吉林市| 黄平县| 泸水县| 广德县| 九龙城区| 梁山县| 县级市| 石泉县| 景东| 西藏| 东源县| 佛坪县| 高密市| 武宣县| 成武县| 赤峰市| 永昌县| 鹰潭市| 榆社县| 泸水县| 盐山县| 大新县| 三原县| 海原县| 吴江市| 蓝山县| 洮南市| 从江县| 工布江达县| 勃利县| 湛江市| 开远市| 武胜县| 乐至县| 济源市| 章丘市| 呼和浩特市| 南丰县| 兴隆县| 哈巴河县|