How can I make a gallery like popular photo reports?
Explain in detail
http://share.pho.to/AftAq
In this photo gallery there is an opportunity to scroll through the photo, and also resize each photo
I used the following example gallery:
https://github.com/BowlerHatLLC/feathers/tree/master/examples/Gallery
How to add the opportunity to me the size of the photo?
private function onTouch(event:TouchEvent):void { var _currentImage:GalleryItemRenderer = event.currentTarget as GalleryItemRenderer; //_currentImage.layoutData = null; var touches:Vector.<Touch> = event.getTouches(_currentImage, TouchPhase.MOVED); var _parent = _currentImage.parent; if (touches.length == 2) { // two fingers touching -> rotate and scale var touchA:Touch = touches[0]; var touchB:Touch = touches[1]; var currentPosA:Point = touchA.getLocation(_currentImage.parent); var previousPosA:Point = touchA.getPreviousLocation(_currentImage.parent); var currentPosB:Point = touchB.getLocation(_currentImage.parent); var previousPosB:Point = touchB.getPreviousLocation(_currentImage.parent); var currentVector:Point = currentPosA.subtract(currentPosB); var previousVector:Point = previousPosA.subtract(previousPosB); var currentAngle:Number = Math.atan2(currentVector.y, currentVector.x); var previousAngle:Number = Math.atan2(previousVector.y, previousVector.x); var deltaAngle:Number = currentAngle - previousAngle; // update pivot point based on previous center var previousLocalA:Point = touchA.getPreviousLocation(_currentImage); var previousLocalB:Point = touchB.getPreviousLocation(_currentImage); _currentImage.pivotX = (previousLocalA.x + previousLocalB.x) * 0.5; _currentImage.pivotY = (previousLocalA.y + previousLocalB.y) * 0.5; // update location based on the current center _currentImage.x = (currentPosA.x + currentPosB.x) * 0.5; _currentImage.y = (currentPosA.y + currentPosB.y) * 0.5; // rotate _currentImage.rotation += deltaAngle; list.pageWidth = _currentImage.width; } }
But the list has a layout photo can not resize
If temporarily remove layout
if (touches.length == 2) list.layout = null;
Shows an error