Simple zoom pan example

Hello Freinds i am working on image editing.and need to zoomIn Zoom Out the my image.I m following that link.
http://www.adobe.com/devnet/flex/samples/fig_panzoom/
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

hi
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:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<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:HGroup>
<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()"/>
</s:Group>
</s:Panel>
</s:Application>

Similar Messages

  • Zooming/panning using the mouse wheel scroll

    Hey everyone,
    Lately I've been frustrated by the functionality of the zoom in Photoshop - and I don't mean the Zoom Tool, but simple zoom in/out operations. I seem to recall that the default behaviour in Photoshop was that you zoomed with Ctrl+mousewheel scrolling, and if you just scrolled, then the picture would pan up/down (vertically). And you could untick the "Zoom with scroll wheel" option if you didn't want Ctrl+scroll to mean "zoom".
    However for a while now, having that option ticked seems to mean that scrolling (with no Ctrl) is all it takes to zoom in/out, and if you untick the option then you need to press Alt+scroll to zoom; in either case, there is no shortcut for panningup/down.
    Anyway, whether this was really ever the case or not, my question is: is it somehow possible to make it so Ctrl+scroll zooms and (simple) scroll pans vertically? Anticipated thanks for any help.

    What PS version are we talking about?
    Here is the behavior I see in CS4 when all the Zoom options are unchecked in Edit>Preferences, General tab:
    - Scroll wheel alone: Vertical pan
    - Scroll wheel & Ctrl: Horizontal pan (a little weird that since the cursor changes to a plus magnifying glass)
    - Scroll wheel & Alt: Zoom
    It's not exactly what you asked for but it's close (Alt instead of Ctrl for zoom).

  • Wacom Intuos Pro with Ai zooming/panning using the stylus not working

    I'm having a problem with my Intuos Pro Medium tablet in Adobe Illustrator CC 17.1.0 (Mac OSX 10.9.2) while zooming/panning using the stylus.
    I've set my primary button on the pen on Pan/Scroll.
    When you hold alt/option+primary button on the stylus (pan/scroll)+drag, you could zoom in/out. (like you would if you were to hold alt/opt and push up on the trackpad with two fingers to zoom in or out - doing this works)
    When you hold the primary button, you could pan around the artboards.
    I used this alot before in the past with an Intuos 4 with an old driver but now it doesn't work with the new tablet and drivers.
    Instead when I hold the primary button it shows only the grabber hand (which is no help).
    I have tested this in Photoshop on the same machine and it works as it should, I can Zoom and Pan properly.
    Please help - is there a setting I am missing somewhere in Ai?

    Kelly,
    Sorry for our lack of response. We hope you have been able to resolve this problem, it's not one we have seen ourselves. Single click and drag should be working with an Intuous Pro on Mac or Win. Back in February you may have still been using the older AIR based version of Muse. The Muse CC and CC 2014 may have ale have fixed that issue. Please let us know if this is still affecting you...
    Thanks,
    Dave

  • Error in Simple Input Form Example for CE 7.1?

    Hi @,
    I am trying to execute Simple Input form example in sdn for CE 7.1. But its not working as per the functionality.
    Can anyone suggest what is the issue ?
    Regards,

    hi,
    This particular example is given in the sdn and is for ce 7.1 but its not working .
    Regards

  • Is apple going to fix the magic trackpad issue with Autocad zoom/pan soon? It only started happening when I updated to Yosemite

    is apple going to fix the magic trackpad issue with Autocad zoom/pan soon?
    It only started happening when I updated to Yosemite
    I am using macbook pro 15" Retina

    Although it not only bothers me but alot of other photo booth users aswell

  • Simple Java DB example

    I am using Java 1.6 and Eclipse Galelio on Vista, Do I need to configure anything is there any story of setting path?
    How to check my Java DB is working or not or everything is fine or not?
    I found many totorial with simple Java DB example but they seem dealing with previous version of JDK, I guess SUN too on http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javadb/ , kindly provide me the simplest example which uses Java DB.
    I am not able to figure out the whole thing of JAVA DB , how it works, in plain language I want to know is there any way of interacting with database from Command prompt? If so how?

    When I am running a simpleApp.java
    I am getting this error:
    Unable to load the JDBC driver org.apache.derby.jdbc.EmbeddedDriver
    Please check your CLASSPATH.
    java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at SimpleApp.loadDriver(SimpleApp.java:414)
         at SimpleApp.go(SimpleApp.java:125)
         at SimpleApp.main(SimpleApp.java:93)
    ----- SQLException -----
    SQL State: 08001
    Error Code: 0
    Message: No suitable driver found for jdbc:derby:derbyDB;create=true
    SimpleApp starting in embedded mode
    SimpleApp finished

  • Simple XML DOM Example Needed.

    I need a simple XML DOM Example that reads in the XML and makes objects out of the elements. The tutorial from sun is very sketchy and seems to good far too quickly.
    Thanks,
    Dave.

    You can find some examples:
    http://java.sun.com/xml/jaxp/dist/1.0.1/examples/#building
    http://newinstance.com/writing/javaxml2/javaxml2_examples.html
    http://www.docuverse.com/domsdk/index.html#tutorial
    http://www.devx.com/sourcebank/search.asp

  • Can the Adobe Photoshop Layer Support with Captivate 4 be use to show a Zoom & Pan Effect?

    I'm working with a client that is interested in creating the "Zoom & Pan" effect you get with Camtasia using Captivate 4.  I'm not finding enough information to support that this is possible with Captivate 4.  The Photoshop Layer Support feature with Captivate 4 comes across as something that may work to some degree however, it is again unclear if it would definitely work to give the zoom & pan effect I am looking for.  Would anyone mind explaining this feature in greater detail and/or offering any ideas for how I can show the zoom & pan effect in Captivate 4?

    Hi there
    LOL, good luck with that!
    NOTHING in Captivate will achieve what you are seeing in Camtasia. Sorry, there simply is no comparison. Sure, Captivate has panning while recording, but what you end up with are several herky jerky snapshots of suddenly being in a different screen area. Sort of reminds me of walking through a room while slowly closing and opening your eyes. In other words, you are seeing version 1 of the panning feature. We hope it improves, but it's not there yet.
    If you have Camtasia, you could combine it with Captivate for some nice and interesting effects and have the best of both worlds! I do that.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • FCP 6 stills shake when zoom/pan

    I am having a problem with some stills shaking when I zoom/pan them. I have knocked down the image size and file size in photoshop but the problem still keeps coming back.

    Listen to Tim.
    Here's the larger explanation.
    The flickering you see is an artifact of the interlaced nature of video. It is a result of either very thin (often horizontal) elements that exist on one scanline as is common in text/ titling or scanned images with a great deal of detail in high contrast. (Note: It does no good to import images hugely larger than the necessary pixel dimensions of the video sequence. All it does is force FCP to work harder at interpolation.)
    As the alternate fields play, the offending element is essentially being turned on/off creating the impression of a flicker. The basic strategy is to get the element to exist over two scanlines so it is refreshed every time the field plays and/or to reduce the amount of contrast so the difference between ON and OFF is not noticeable.
    Things to try (In increasing order of image degradation)
    • (in FCP) field order>none
    • (in FCP or Photoshop) reduce whites by 10% - reduces overly bright areas
    • (in FCP) flicker filter - minimum
    • (in Photoshop) motion blur>vertical> .2 - .5 pixels - blurs vertically only
    • (In FCP or Photoshop) Gaussian blur> .2 - .5 pixels -blurs both horizontally as well as vertically
    • (in FCP or Photoshop) deinterlace - throws away half the image and is generally not appropriate on scanned or still images.
    One neat trick is to use the selection tool to limit area you apply the vertical and/or gaussian blur to only the troublesome part rather than indiscriminately soften the entire thing.
    Remember: Unless you are viewing your work in the appropriate external NTSC/PAL monitor, you are playing blind. The computer monitor only shows you a proxy image.
    good luck.
    x

  • Interlace problems with zooms/pans on stills

    We are working on a simple slide show with still images. There is a wavering quality to the images as they zoom or pan across the screen. It creates a kind of moray effect that is unpleasant. The movie is going to be projected onto a large screen so it will look even worse. I can't seem to find a way to de-interlace the images except in photoshop. Is that my only option or is there some way to turn off interlace in imovie?

    wavering quality to the images as they zoom or pan across the screen
    That seems to indicate that you used the Ken Burns effect to pan/zoom the images, right? If yes, then you should not be a victim of the nasty old iMovie 3-5 bug Sue provided a link to.
    IMO Photo To Movie's high quality setting renders better quality Ken Burns than, erm, iMovie's Ken Burns effect. Maybe the wavering is caused by suboptimal subpixel rendering in iMovie? (wow, that was a great sentence

  • Charting zoom/pan control

    Using Measurement Studio 7.0 with C#, I wasn't able to set my Chart into "Zoom mode" like I could in 6.0 with VB6. The only solution is to shift-click/ctrl-click.
    Previously, I would use this code to create tool buttons the user could click on to set the chart into zoom mode and pan mode:
    Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
    Dim i As Integer
    Select Case Button.Key
    Case "ChartToolZoom":
    For i = 0 To NUM_STRIP_CHARTS
    strip1(i).TrackMode = cwGTrackZoomRectXY
    Next
    ' set new mouse icon
    FrmDataGraph.MousePointer = vbCrosshair
    Case "ChartToolPan":
    For i = 0 To NUM_STRIP_CHARTS
    strip1(i).Tr
    ackMode = cwGTrackPanPlotAreaXY
    Next
    ' set new mouse icon
    FrmDataGraph.MousePointer = vbSizeAll
    Case "ChartToolZoomOut":
    For i = 0 To NUM_STRIP_CHARTS
    strip1(i).Axes(1).AutoScaleNow
    strip1(i).Axes(2).AutoScaleNow
    strip1(i).TrackMode = cwGTrackAllEvents ' cwGTrackDragCursor
    Next
    FrmDataGraph.MousePointer = vbDefault
    'GraphHistory
    Case "ChartToolPrint":
    'CmdPrint_Click
    End Select
    End Sub
    Any help setting up such a tool interface again with 7.0 would be greatly appreciated. Also, is there an easy way to print a chart?
    Thanks,
    Martin

    First, regarding the question about printing, here are several suggested links from MSDN about .NET Framework support for printing:
    Windows Forms Print Support
    PrintDocument class
    Introduction to the Windows Forms PrintDocument component
    Printing with the PrintDocument Component
    PrintPreviewControl class
    Introduction to the Windows Forms PrintPreviewControl
    PrintDialog class
    An example of how to print the graph with PrintDocument would be to add a PrintDocument component to your form, double click on the PrintDocument to generate an event for the PrintPage event, then do something like this (assuming you have a WaveformGraph or ScatterGraph called graph):
    private void OnPrintDocumentPrintPage(object sender, PrintPageEventArgs e)
    Rectangle bounds = new Rectangle(e.MarginBounds.Location, graph.Size);
    ComponentDrawArgs args = new ComponentDrawArgs(e.Graphics, bounds);
    graph.Draw(args);
    When you're ready to print, call the Print method on the PrintDocument.
    Regarding the ability to enable an interaction mode without keyboard modifiers, there is not a direct way to do this. The advantage of the keyboard modifiers is that it allows you to have multiple modes enabled at the same time and a way to easily switch between them interactively, but the disadvantage is that there's not an easy way to toggle them via toolbars as you're trying to do. This is good feedback and I will file a suggestion to consider this for a future release.
    There is a way to workaround this by synthesizing the keystrokes for the interaction keyboard modifiers, though. Below is a helper class called AutoInteractionMode that will work with either WaveformGraph or ScatterGraph. To use it in your project, create a class member variable for the AutoInteractionMode, then initialize it in your constructor after the InitializeComponent call, like this:
    public class MyForm : Form
    private AutoInteractionMode _autoInteraction;
    // This could be a ScatterGraph as well.
    private NationalInstruments.UI.WindowsForms.WaveformGraph waveformGraph1;
    public MyForm()
    InitializeComponent();
    _autoInteraction = new AutoInteractionMode(waveformGraph1);
    Once this is hooked up, you can set the InteractionMode property to correspond to the modes that you're toggling via the toolbars, and the AutoInteractionMode should do the right thing when the mouse enters the plot area without the use of the keyboard modifier. Hope this helps.
    - Elton
    class AutoInteractionMode
    private bool _mouseInPlotArea;
    private bool _enabled;
    private XYGraph _graph;
    private const GraphInteractionModes PanMask = GraphInteractionModes.PanX | GraphInteractionModes.PanY;
    private const GraphInteractionModes ZoomMask = GraphInteractionModes.ZoomAroundPoint | GraphInteractionModes.ZoomX | GraphInteractionModes.ZoomY;
    public AutoInteractionMode(XYGraph graph)
    if (graph == null)
    throw new ArgumentNullException("graph");
    _mouseInPlotArea = false;
    _enabled = false;
    _graph = graph;
    Enabled = true;
    public bool Enabled
    get
    return _enabled;
    set
    if (value && !_enabled)
    _graph.MouseMove += new MouseEventHandler(OnGraphMouseMove);
    else if (!value && _enabled)
    _graph.MouseMove -= new MouseEventHandler(OnGraphMouseMove);
    _enabled = value;
    [StructLayout(LayoutKind.Sequential)]
    private struct MOUSEINPUT
    public int dx;
    public int dy;
    public int mouseData;
    public int dwFlags;
    public int time;
    public int dwExtraInfo;
    [StructLayout(LayoutKind.Sequential)]
    private struct KEYBDINPUT
    public short wVk;
    public short wScan;
    public int dwFlags;
    public int time;
    public int dwExtraInfo;
    [StructLayout(LayoutKind.Sequential)]
    private struct HARDWAREINPUT
    public int uMsg;
    public short wParamL;
    public short wParamH;
    [StructLayout(LayoutKind.Explicit)]
    private struct INPUT
    [FieldOffset(0)] public int type;
    [FieldOffset(4)] public MOUSEINPUT mi;
    [FieldOffset(4)] public KEYBDINPUT ki;
    [FieldOffset(4)] public HARDWAREINPUT hi;
    private const int INPUT_KEYBOARD = 1;
    private const int KEYEVENTF_EXTENDEDKEY = 0x0001;
    private const int KEYEVENTF_KEYUP = 0x0002;
    private const int KEYEVENTF_UNICODE = 0x0004;
    private const int KEYEVENTF_SCANCODE = 0x0008;
    [DllImport("user32.dll")]
    private static extern uint MapVirtualKey(uint uCode, uint uMapType);
    [DllImport("user32.dll")]
    private static extern uint SendInput(uint nInputs, [In] INPUT[] pInputs, int cbSize);
    private static void SendKeyUp(Keys key)
    Send(key, true);
    private static void SendKeyDown(Keys key)
    Send(key, false);
    private static void Send(Keys key, bool keyUp)
    INPUT[] input = new INPUT[1];
    input[0].type = INPUT_KEYBOARD;
    input[0].ki.wVk = (short)key;
    input[0].ki.wScan = ((short)MapVirtualKey((uint)key, 0));
    input[0].ki.dwFlags = ((IsExtendedKey(key) ? KEYEVENTF_EXTENDEDKEY : 0) | (keyUp ? KEYEVENTF_KEYUP : 0));
    input[0].ki.time = 0;
    input[0].ki.dwExtraInfo = 0;
    SendInput(1, input, Marshal.SizeOf(typeof(INPUT)));
    private static bool IsExtendedKey(Keys key)
    return (((key < Keys.Space) || (key > Keys.F15)) && ((key != Keys.Tab) && (key != Keys.Enter) && (key != Keys.LineFeed)));
    private void OnGraphMouseMove(object sender, MouseEventArgs e)
    Point pt = new Point(e.X, e.Y);
    if (_graph.PlotAreaBounds.Contains(pt))
    if (!_mouseInPlotArea)
    _mouseInPlotArea = true;
    if ((_graph.InteractionMode & ZoomMask) > 0)
    SendKeyDown(Keys.ShiftKey);
    else if ((_graph.InteractionMode & PanMask) > 0)
    SendKeyDown(Keys.ControlKey);
    else
    if (_mouseInPlotArea)
    _mouseInPlotArea = false;
    if ((_graph.InteractionMode & ZoomMask) > 0)
    SendKeyUp(Keys.ShiftKey);
    else if ((_graph.InteractionMode & PanMask) > 0)
    SendKeyUp(Keys.ControlKey);

  • PAN & ZOOM: "Pan only" not here anymore

    Hello
    When I try to make a panorama, the "pan only" option i could chose before does not appear in the overlay creator "pan & zoom", i only got the choice between "not activated/activated"
    And then I just can't figure out how to make a panorama. Used to be simple !
    Did I miss an Adobe episode ?

    Pan Only was removed from the Pan & Zoom overlay and turned into the Scrollable Frames overlay in v19. To create a panorama, you need the Panorama overlay:
    http://help.adobe.com/en_US/digitalpubsuite/using/WS9293e1fb3b977c5c73657495129f66e490f-7f fd.html

  • Simple EJB3/JAAS Example?

    Hello. I'm trying to write a simple prototype using an EJB3 stateless session bean and JAAS, but running into some problems. Does anyone know of a complete example that explains how to create a security-enabled EJB and deploy it to WebLogic?
    I have some stuff working, but seem to be stuck now. I am unsure how to assign identities to roles. So far, I wrote a custom LoginModule that will successfully login if the passed username/password is one of the hard-coded combinations. In the Subject, I am setting the PasswordCredential object, and putting a Principal whose name is the username. The EJB call fails with an error saying that the user doesn't have sufficient privileges because I have not associated the hard-coded username with any of the roles that I specify in the EJB using @RolesAllowed.
    Any help or suggestions would be greatly appreciated.
    Thanks,
    Mike

    Hello!
    I get the exact same error.
    Fortunately i have discovered a realm name mistake (im my case,
    COMPANYNAME.LOCAL instead of COMPANYNAME.COM).

  • Simple image pan using Flash CS3

    I need help panning a long jpeg image resting on the bottom layer of my first Flash project.
    I simply need to pan the image from right to left in a continuous loop, which I'm sure is a simple thing to program, yet I can't seem to locate instructions or a tutorial that explains it.
    Can anyone help?

    Try the following tutorial...
    http://www.tutorialized.com/view/tutorial/Continuously-Scrolling-Image/2520

  • PDF pinch and zoom, panning bug with latest version?

    I have found stumbled upon something strange with PDF folios with Zoom enabled with the latest version. When you zoom in and pan around if you pan left<->right and then try to pan up<->down without releasing the pan, it is locked in a left<->right panning motion.  Similarly if you start the panning motion in a vertical direction, and continue to hold your panning you cant pan horizontally. However, if you start panning when swiping diagonally, then you are able to pan in all directions. Is this intended behaviour?  I checked with a PDF folio built with Sprint 18 it doesnt have this behaviour. Perhaps its only happening to me and im doing something to cause it? Wondering if anyone else in the community can test if it is happening with their Sprint 19 readers.

    Confirmed.
    Bob

Maybe you are looking for

  • I have an application in my Firefox Options which I can't remove any help would be great

    I have a download torrent called Bitlord which I have removed through my control panel - but it appears it is still there in my Options Applications which I can't removed - any help would be great

  • Timeout for content

    Hello 9iAS with Portal 9.0.2 in Sun Solaris I am working with Oracle Reports Builder and Oracle Portal. I've saved my reports with JSP extension. So, I've made some portlets with these reports into PEOPLE_APP db provider. Now, when I run my pages wit

  • If I dont embed when sending form fcp how do I get it back?

    I'm new to motion so sorry if this is a real stupid question but.. I'm using motion to make my titles. I've done some tutorials and I've been selecting what I want to add the title to and go send to motion. When the widow opens I've been leaving the

  • TA48312 what realplayer version is compatible with the new safari

    good day everyone,what version of realplayer works well with the new safari,i am not able to download videos from youtube anymore,thanks

  • 8i on Linux Shipment notice

    Well folks, now we know. It's not shipping until the last week of May, probably June. I was kind of hanging around - waiting for the Linux version rather than trying it on NT. Oh well. Steve null