2011-12-29 64 views
0

我有一個關於變焦的同時操作的查詢,並在同一時間將圖像旋轉.... 其實我想應用旋轉和使用AS3圖像放大的TransformGestureEvent旋轉+放大AS3

+1

什麼是您查詢例如手勢識別庫?有很多例子在做縮放和旋轉的同時,這不是一個非常具體的問題。 – imp 2011-12-29 11:20:28

回答

0

你應該使用Matrix class。從this post創建的變化:

function rotateAndZoom (
     ob:*, 
     angleDegrees:Number, 
     zoomAmt:Number, 
     ptRotationPoint:Point 
) { 
     var m:Matrix = ob.transform.matrix; 

     m.tx -= ptRotationPoint.x; 
     m.ty -= ptRotationPoint.y; 

     m.rotate (angleDegrees*(Math.PI/180)); 
     m.scale(zoomAmt, zoomAmt); 

     m.tx += ptRotationPoint.x; 
     m.ty += ptRotationPoint.y; 

     ob.transform.matrix = m; 
} 

讓我知道這是否解決了問題。

+0

感謝給我的代碼它的工作 – sandeep 2012-02-28 12:36:04

+0

如果它的工作,那麼它解決了你的問題是正確的?然後將其標記爲答案。 – 2012-11-07 07:54:31