Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 45
Registered: ‎03-07-2011
My Device: Not Specified

Testing Pinch to Zoom

[ Edited ]

Hello, I am testing pinch-to-zoom but don't know how the performance will be on the real device. Can someone test this for me? Thanks.

 

Multitouch.inputMode = MultitouchInputMode.GESTURE;

var img:Image = new Image();

img.smoothing = false;

img.cacheAsBitmapMatrix = new Matrix();

img.cacheAsBitmap = true;

img.setImage(>>Some image<<);

img.addEventListener(TransformGestureEvent.GESTURE_ZOOM,

function(e:Event):void

{

// This does translate the image to the correct position (origin is 0,0). Wanted to keep the code as simple as possible.

img.scaleX *= e.scaleX;
img.scaleY *= e.scaleY;

});