简体   繁体   中英

Rotate+ Zoom in AS3

我有一个关于同时操作缩放和旋转图像的查询..实际上我想使用TransformGestureEvent在as3中对图像应用旋转和缩放

You should use the Matrix class . Creating a variation from 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;
 }

Let me know if this solves the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM