1 Reply Latest reply on May 13, 2010 7:22 AM by David_F57

    Simple zoom pan example

    vineet osho

      Hello Freinds i am working on image editing.and need to zoomIn Zoom Out the my image.I m following that link.



      but its quiet difficult to implement, and its to much advanced.i need simple zoom.but the main point is that i need to zoomin and zoom out particular part of an image.i mean to say any part of the image can be zoom in and zoom out.plz plz plz help me out,i m totally confused with this heavy code



      Thanks and regards

            Vineet Osho

        • 1. Re: Simple zoom pan example
          David_F57 Level 5



          this is about as simple as you can get it


          create a new project replace the code with this and add an image to your project for testing.


          <?xml version="1.0" encoding="utf-8"?>

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"


             xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">


          <!-- Place non-visual elements (e.g., services, value objects) here -->


          <s:HGroup horizontalCenter="0" top="10">

          <s:Button label="zoom in" click="img.scaleX=img.scaleX+0.25;img.scaleY=img.scaleY+0.25"/>

          <s:Button label="zoom out" click="img.scaleX=img.scaleX-0.25;img.scaleY=img.scaleY-0.25"/>


          <s:Panel x="87" y="150" width="600" height="480" verticalCenter="0" horizontalCenter="0">

          <s:Group top="0" left="0" bottom="0" right="0" clipAndEnableScrolling="true">

          <mx:Image id="img" x="95" y="78" width="408" height="306" source="test.jpg"

            mouseDown="img.startDrag()" mouseUp="img.stopDrag()"/>