Zoom and Drag

In [this thread|https://forums.oracle.com/forums/thread.jspa?messageID=10034311#10034311] I asked about how to clip an image when you zoom in on it, so that you don't take a big memory and processing hit. But having an answer to this question, I'm left with the issue - which I'm sure has been solved by others - of how to allow the user to move the image (as you do when you drag across a Web-based map so that you can bring the object you want to look at into the center of the view.) My code had allowed the user to do this when it had the flaw of keeping the whole image in memory. But now that the image is clipped, the user can't do this anymore. I suppose that in order to solve this, you have to create that part of the image the user is dragging into view. There must be established ways of doing this. I'd appreciate any tips.

I've not done this for a couple of years now, but look at BufferedImage and Graphics api's. getSubImage is a nice little method that will give you part of the main image--you are strill actually looking at the main image, but just part of it. Also drawImage is what you want to use into a new Graphics context for viewing that part of the image. If you want to do anything to that subimage and not have it in effect on the main image, you'll need to create a new Image (If I recall correctly that subimage and image both have the same graphics contexts--they point to the same area).

Similar Messages

  • Zoom and drag help

    Hi everyone
    I am making a page turning book much like this example
    http://www.merc-clothing.com/newspaper.asp
    Ok a lot like this example, the size of my double page spread
    is
    1095 by 777 and the top left position is X-550 Y-457
    I have almost completed it but the one problem is when I zoom
    in and drag the page around there is no script to tell it not to
    let the page be dragged of the screen I hope this makes sense.
    Also when you zoom back out the page doesn’t return to
    the position it was before
    would anyone know where and what to add to this script to
    stop my mc being dragged so far the next set of page are revealed
    underneath and so when you zoom back out it returns to its original
    position
    I am a complete idiot regarding actionscript so please be
    gentle
    Thanks for your time
    this is the script im using now to zoom in and drag
    zoom_drag_zoom(newsMC, 100);
    function zoom_drag_zoom(myMC, myScale)
    // 1st param = the MovieClip you want to allpy this
    functionality to.
    // 2nd param = the amount you want it scaled down by when
    zoomed out
    // if no amount is give it will default to 50%
    // Deak's zoom, drag, zoom. 2006
    // allows you to zoom in to an MC
    // onPress, drag MC onMouseDown
    // and zoom out onRelease
    // sets the scale to 50% if no scale is given.
    myScale = (!myScale) ? 50 : myScale ;
    trace("myScale:"+myScale);
    //var myMC:MovieClip = newsMC;
    //initially reduce the size of the mc
    myMC._xscale = myScale;
    myMC._yscale = myScale;
    // set variables to false
    var zoomedIn:Boolean = false;
    var dragging:Boolean = false;
    // onPress is triggered as the mouse is clicked
    myMC.onPress = function()
    // checks to see if the MC is zoomed in (not zoomed).
    if (!zoomedIn) {
    // if the MC is not zoomed then increase scale to 100%
    myMC._xscale = 200;
    myMC._yscale = 200;
    // set variable to true, to be used later
    zoomedIn = true;
    dragging = true;
    // onMouseDown is also triggered as the mouse is clicked
    // N.B. even if the onMouseDown appears after the onPress it
    will be triggered first
    myMC.onMouseDown = function()
    // checks to see if the MC is zoomed in (is zoomed).
    if (zoomedIn) {
    // add a mouse listener
    Mouse.addListener(mouseListener);
    // Mouse listener is triggered when the mouse is down and
    only if the MC has been zoomed in.
    var mouseListener
    bject = new Object();
    mouseListener.onMouseMove = function ()
    // starts the drag of the MC
    startDrag(myMC);
    // set variable to true
    dragging = true;
    // the MC is now draggable so we can remove the lsitener.
    Mouse.removeListener(mouseListener);
    // onMouseUp is trigger when the mouse button is released,
    this will always proceed an onRelease.
    myMC.onMouseUp = function()
    // This removes the listener and stops the drag, called here
    so if you click the MC but do not move the mouse it will not
    prevoke the startDrag
    Mouse.removeListener(mouseListener);
    myMC.stopDrag();
    // onMouseUp is trigger when the mouse button is released
    myMC.onRelease = function()
    // condition: if MC is zoomed and you are NOT dragging the
    MC
    if ( (zoomedIn) && (!dragging) ) {
    // reduce scale
    myMC._xscale = myScale;
    myMC._yscale = myScale;
    // reset the variables
    zoomedIn = false;
    dragging = false;
    // this is placed here at the end of the onRelease to set
    the dragging variable to false.
    // if this was placed in the onMouseUp then the MC would get
    zoomed out as "dragging" would be false.
    dragging = false;
    stop();

    I would really like to know this too.
    If you look at the help file:
    http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-74dba.h tml#WSfd1234e1c4b69f30ea53e41001031ab64-74daa
    (I hope that's a functional URL) It says that the old drag-zoom thing should still work. But I still get the "scrub" style zooming. None of the pref settings seem to affect it. Help!

  • Is there any way I can get "click and drag" zoom in CS5?

    As a long-time Photoshop user, it is making me crazy that "click and drag" zoom no longer works.  I hate the "fly-in" zoom.   I've turned off Animated Zoom (and all the other zoom options) but nothing helps.  Is there a solution for this?

    Look at the options for the zoom tool, and turn off the checkbox for scrubby zoom.

  • Transparent Background Actual Pixels and Clicking and Dragging Zoom

    So I had to reinstall Photoshop for a number a reasons, and because of this I lost all of my settings.
    There's two settings I lost and don't remember what I did to turn them on.
    1. The Transparent Background is actual pixel size.
    I don't like zooming in and seeing the transparent background not change. I liked it when it was 12x12 pixels per transparent box. What setting do I have check or change to get that back to normal?
    Example: http://puu.sh/9zjjb/1d48b7ebd5.png
    2. Clicking and Dragging Zoom.
    When I now click and drag, I gives me an area I want to zoom in. I don't like this at all. I'm not animating in flash, I'm just drawing. I liked it better when I clicked and dragged up, down, left or right to zoom in on the area I clicked on. What setting is that to enable that?
    Example: http://puu.sh/9zj8O/ec329b1d6f.png
    I'm using Photoshop Cs6.
    If someone can tell me how to fix both of these problems I'm having, that would be grand.

    The way you're seeing it work now (with the checkerboard size remaining the same on the screen no matter what the zoom) is the expected way with the Graphics Processor Advanced settings set to Drawing Mode Normal or Advanced.  If you want it to work the way it did before, go into your Preferences - Performance dialog, click the [Advanced Settings...] button, and choose Basic drawing mode.
    Regarding the Zoom...  Select the Zoom Tool, and look in the Options bar (up near the top of the Photoshop main window).  Change the [ ] Scrubby Zoom checkbox.
    -Noel

  • How to add a hand tool (grab the page and drag) function on Chrome and firefox pdf viewer?

    To clarify, hand tool is a function for user click on the pdf and dragging around , that is used to replace the scroll bar navigating .
    The problem is, by default the Chrome and firefox pdf viewer do not have that function and I would like allow the user to drag the page.
    A workaround is to use a jquery plugin (grab to pan https://github.com/Rob--W/grab-to-pan.js in my case) with an embed object (pdf viewer). When I maximum the size of the pdf and user drag the embed object.
    The problem I have encounter is
    1) When using chrome/ firefox, the pdf content do not fit to the page but auto resize by default even I have set the adobe pdf open parameter , using iframe.
    2) The jquery seems conflict with the firefox pdf viewer, it works smoothly on Chrome but not firefox.
    Here is the source code, you may download the plugin from the link mention above and have a look. Don't forget to put a '1.pdf' along with the source file. Thanks
        <!DOCTYPE html>
        <head>
        <meta charset="utf-8">
        <title>Grab-to-pan.js demo</title>
        <link rel="stylesheet" href="grab-to-pan.css" type="text/css">
        <style>
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        .scrollable {
            overflow: auto;
            width: 100%;
            height: 100%;
            background-color: #EEE;
        #zoomPage {
                  overflow:visible;
            width: 100%;
            height: 150%;
        </style>
        </head>
        <body>
        <label><input type="checkbox" id="activate-g2p" checked> Activate Grab to Pan</label>
        <div class="scrollable" id="scrollable-container">
        <object id = 'zoomPage' type='application/pdf' data= '1.pdf#zoom=page-fit'><p>The PDF can not display</p></object>
        </div>
        <script src="grab-to-pan.js"></script>
        <script>
        document.getElementById('activate-g2p').onchange = function() {
            if (this.checked) g2p.activate();
            else g2p.deactivate();
        var scrollableContainer = document.getElementById('scrollable-container');
        var g2p = new GrabToPan({
            element: scrollableContainer
        g2p.activate();
        </script>
        </body>
        </html>

    This is forum sponsored by Adobe make of Acrobat and Reader. Since Chrome and FireFox web browser have chosen to use their own viewer you might get more help in their forums or customer support.

  • Selecting and Dragging multiple clips - CS6 Sniper mode

    With the introduction of ability to select Edit Points, now it's inconvenient to drag multiple selected clips or add clips to selection because in some cases - depending on timeline zoom state and/or clip duration. The edit points are altered instead of the clips, that behaviour drives me nuts. It leads to a necessity to do one of the following actions before selecting and/or dragging multiple clips with comfort:
    sniper mode - put the cursor over a place in the selection where the cursor will not indicate Edit Point trimming mode.
    to avoid loosing selection when using sniper mode - Group the clips after adding every clip to selection and/or after a dragging operation
    dynamically change zoom state so that you will not have to use sniper mode
    use copy/cut/paste - may involve a necessity to do additional pre-pasting steps
    IMHO, this behaviour should be rethinked.
    How fast it was in CS5.5 and older versions:
    Please, Premiere Pro Programming Team, especially Tim Gogolin, Steve Hoeg, Peter Lee, Gerry Miller, James Mork, Vivek Neelamegam, Axel Schildan, Jerry Scoggins, Sven Skwirblies, Tod Snook, Jesse Zibble, rethink the behaviour of selecting and dragging clips. Start giving links to beta-versions to other editors too, not only to editors like Philip Bloom.
    Selecting edit points is sometimes helpful and sometimes distracting.
    To get the best of two worlds (CS6 edit points vs. CS5.5 and older) - a switch could be added to Keyboard Shortcuts list, like the "hidden" Add Clip Marker shortcut.
    Let's name it "Application > Sequence > Select Edit Points".
    When Shift- or Shift+Alt- key is pressed and some Clip is selected, clicking on an edit point of another clip should add a clip to selection in the same way as previous versions of Premiere Pro did:
    To drag clips in legacy sniper-free mode only a switch can help. Let's name it "Application > Sequence > Select Edit Points when Multiple Clips are Selected".
    To add comfort to the editing process - selecting/dragging multiple clips - additional switches cannot be avoided. Additionally you may add an option to the Preferences > Trim:
    Allow Selection tool to choose Roll and Ripple trims without modifier key
    Allow Selection tool to select Edit Points while multiple Clips are selected
    Feature Request/Bug Report Form
      ******BUG******
    Concise problem statement:Inconveniences when selecting and dragging multiple clips
    Steps to reproduce bug:
    1.Create a Selection of multiple clips with Shift+Click
    2.Try to drag the clips
    Results:With the introduction of ability to select Edit Points, in some cases (depends on timeline zoom state and/or clip duration) now it's inconvenient to select and drag multiple selected clips because the edit points are selected instead of the clips
    Expected results:Clips should be selected/dragged like in CS5.5 and older
    Link: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

    With all due respect Kevin, nobody at Adobe has the right to change a program SO drastically.  I am also a mouse person, and am MUCH faster using the mouse, vs the keyboard. 
    When people have invested YEARS into a program like Adobe, they get used to things, how things work, the feel of a program.  I really don't see how you all can just change it on a whim.  IF you are going to do this, BOTH methods should still work.  You cannot just stop the way people are used to editing.  You can't just decide to change a program so drastically, that it doesn't feel like a program we have grown to love over many long years.  If Adobe on a whole is changing things, just because a few people in your company voice opinions like I've quoted below, it's not the way to go.  Adobe should be really putting feelers out there, and seeing how people are really using the program.  Things should be getting easier, more powerful, sure that's natural, but you can't just decide to remove things that mouse users do every day. :-(
    Upgrading a program, and changing it to this degree, are two different things in my book.  I have not yet upgraded, but it is very scary - the things I'm seeing.  For one, way way too many bugs.  The amount of bugs on so many boards being reported are just beyond comprehension. 
    And a final note, I for one, am very glad Steven is posting these videos ( I'd like to hear him go through steps though - just watching the video with no audio of what he is doing is not so great, however after watching some of his posts, he's knows what he's doing, and has a good head to think with )
    I mostly read posts, but I thought I would voice my opinion, if none of us speak up, nothing will get changed.  I'm really hoping that Adobe implements some change in the next revision .5 or whatever it will be called.  Reading posts like this one are really depressing.  Did you watch Steven's video on a simple task as moving multiple clips around on a timeline ?  Doing this with a mouse just isn't going to work for many, removing simple tasks by way of using a mouse would stop me from upgrading.
    Please address this in upcoming updates.
    Dave.
    Kevin Monahan wrote:
    I went to NLE school in Hollywood in the 90's. Their mantra was, "never touch the mouse." I rather like the fact that I need to touch the mouse much less in CS6, but this is my personal opinion and the way I was trained.

  • How to make a combined zoom and fade in/fade out effect in Premiere Pro CS4

    Hi everyone,
    Like the title says, I would really love to have an effect I could just drag from the effects menu onto my footage (mostly text titles) so they could fade in for a second, zoom in slightly while they're on screen, and then fade out for the clip's last second.
    That would make my workflow a LOT faster than fiddling with keyframes for the zoom and always grabbing the cross dissolve at the start and end of the text for a few projects I have.  It doesn't sound like much, but when you have moving fading text a couple dozen times in each project and it takes the bulk of your time on the project, the repetition reminds me there has to be a better way.
    That's what a computer is supposed to do, right, take care of simple repetitive tasks?  So how can I get this set up as a reusable effect?
    Thanks!

    Dave,
    I will +1 Pixelan's products. They are great, simple, and have about the best support that I know of. When you explore, say Pixelan's SpiceMaster, dig deeply. Things appear rather mundane, on the surface, but there is so very much power lurking, just below the surface. I could almost imagine a 1000 page manual to cover every possible aspect of that program... Every time that I use it, I learn something new, and wonderful.
    Good luck,
    Hunt

  • I am facing problem zooming and in slide as i think there is some general setting got changed help to rectify.

    i am facing problem zooming and in slide as i think there is some general setting got changed help to rectify.

    If the screen appears zoomed in then try double-tapping the screen with 3 fingers (with zoom 'on' you need to use 3 fingers to drag around the screen), and then go into Settings > General > Accessibility and turn Zoom 'off', and possibly also change what Triple-Click Home is set to.

  • Create Interactive Zoom and Pan (in out, left, right)

    Hello Flash Forum,
    I have been checking the forum for ideas and suggestions on
    how to implement an interactive zoom and pan on an image. I would
    like the user to be able to drag a "magnifing glass" over an image,
    and then zoom in (or out) on the area in the magnifing glass, using
    the mouse wheel. How might I go about creating this effect? Or, the
    easier way, steal someone's code who has implemented this kind of
    functionality.
    Thanks
    eholz1

    I am sorry but I do not understand.
    I am not a programer .I have not idea about SDK, how it works neither how to install it.

  • Interactive Zoom and Pan

    Hello Flash Forum,
    I have been checking the forum for ideas and suggestions on
    how to implement an interactive zoom and pan on an image. I would
    like the user to be able to drag a "magnifing glass" or a circle
    over an image, and then zoom in (or out) on the area in the
    magnifing glass, using the mouse wheel. How might I go about
    creating this effect? Or, the easier way, steal someone's code who
    has implemented this kind of functionality.
    Thanks
    eholz1

    You're in the wrong forum. Please post in the DPS forum: http://forums.adobe.com/community/dps
    Bob

  • How can I disable zoom and navigator bar in the interactivity?

    Hello,
    I'm working at a project about I add a interactivity into DPS. First, I create a basic struture code in HTML5 and after I add it to a layer into DPS. Well, It work perfectly, but, two problems appear:
    The navigator bar appear when I touch interactivity layer.
    I can zoom it even I deny it with user-scalable set as "no".
    How can I fix it? I really appreciate some help
    The code I use is:
    <!DOCTYPE html>
    <html>
        <head>
            <title>Test</title>
            <meta charset="utf-8">
            <meta content='width=device-width, minimum-scale=1.0, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' name='viewport' />
            <style>
                #container{
                    width: 100%;
                    height: 100%;
                    background: url('imgs/bg.jpg') repeat;
            </style>
        </head>
        <body>
            <div id="container"></div>
        </body>
    </html>

    Oh, thanks again.
    Yep... It really work, but, I've a game and I set a container with touch gestures (start, move and end) to deny zoom and pop up navigator bar (container { width: 768px; height: 924px; } ), and now the user can't leave the page by touch/dragging on the div, and then for my buttons (to play containerButtons{width: 768px; height: 100px;} ), I need to set touchmove event to it doesn't pop up navigator bar (and again the user can't leave the page). Again I don't think it the best idea :/...

  • Lightroom 5.2 BLURRY When Zooming and Moving

    EDIT: Updating to 5.5 seemed to have fixed this. FINALLY!
    Now when panning around while zoomed in, it no longer pixelates.
    This was not in any previous versions or 5.2 RC. Happens in the develop module.
    1. Everytime I zoom in or out, the image goes BLURRY for a second.
    2. Then when zoomed in and I click and drag, it say's sharp except on the edges that where not in view which get's pixelated, but when I let go of the mouse button, the entire picture goes blurry for 1-5 seconds. Even if I click and drag only 1 pixel over it blurs the entire photo.
    3. It also sometimes does it when  tapping \ to show before and after it goes all blurry and lags before it shows the before.
    4. It does it when  clicking back and forth from one image to another in the photo strip.
    Before it use to be zooming in would look mildly pixelated for a moment, then when clicking and draginng only the edges out of view would look mildly pixeled for a moment. This is driving my nuts I've reinstalled lightroom, deleted the preferencees folder, optimised catalog. Not fixed. It's also slower than it use to be.
    Example. Sometimes the blur is even worse. Click to enlarge

    I solved my own issue.  I saw an article @ http://www.lightroomforums.net/showthread.php?19694-Spot-removal-tool-doesn-t-work-with-Wa com-Intuos-5-in-LR-5 that solved my issue.
    Step 1:
    Walcom Tablet Properties
    Step 2:
    Click on Customize and change the default line graph from this:
    Step 3:
    To this
    Step 4:
    Click OK.
    After that, my spot edit tool stopped freezing in LR 5.2 while i was using my intuos 5 pen.
    Prior to doing this, I also did the procedure listed here:  http://forum.wacom.eu/viewtopic.php?f=10&t=8036
    So it's possible that both need to be done in order for the freezing to stop.  I hope this can help others.

  • My iPhone 5 is locked in zoom and I cannot put in passcode to open

    my iPhone 5 is locked on zoom and i cannot put in passcode to open to change zoom

    Hello there, beverlyfromthewoodlands.
    It sounds like you may have inadvertently activate the Zoom Accessibility feature on your iOS device. The following link from the online iOS 8 iPhone User Guide explains how to turn the feature off or deactivate it:
    Zoom - iPhone
    http://help.apple.com/iphone/8/#/iph3e2e367e
    Zoom
    Many apps let you zoom in or out on specific items. For example, you can double-tap or pinch to look closer in Photos or expand webpage columns in Safari. But, there’s also a general Zoom feature that lets you magnify the screen no matter what you’re doing. You can zoom the entire screen (Full Screen Zoom) or zoom part of the screen in a resizable window and leave the rest of the screen unmagnified (Window Zoom). And, you can use Zoom together with VoiceOver.
    Turn Zoom on or off. Go to Settings > General > Accessibility > Zoom. Or, use the Accessibility Shortcut. See Accessibility Shortcut.
    Zoom in or out. With Zoom turned on, double-tap the screen with three fingers.
    Adjust the magnification. Double-tap with three fingers, then drag up or down. The tap-and-drag gesture is similar to a double-tap, except you don’t lift your fingers on the second tap—instead, drag your fingers on the screen. You can also triple-tap with three fingers, then drag the Zoom Level slider in the controls that appear. To limit the maximum magnification, go to Settings > General > Accessibility > Zoom > Maximum Zoom Level.
    You should be able to perform these steps before being required to enter your password.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Random zooming and scrolling

    My system will randomly zoom and or scroll. This is not in Safari – it happens in Indesign, Illustrator, Photoshop and After Effects. Zooming seems totally unpredicatable. Scrolling – that is suddenly I'm being scrolled to somewhere way off to the side of my page, happens mostly when I'm dragging items around – usually when also holding shift or otherwise using smart guides for precise placement. Also often when I release them these items will suddenly jump to somewhere else. I use a Magic Mouse – Every single mouse click / scroll / zoom / swipe / click-somewhere-you-never-thought-of-on-the-mouse / swipe-with-11-fingers feature I can lay my hands on has been turned off. It's annoying, frustrating and really just downright crappy. I expect better from my Apple products. Does anyone have any suggestions / fixes ? (ideally not 'get a corded mouse' ). Thanks.

    Try another Mouse, even a cheap USB mouse... as a test.

  • Is there a clearer video tutorial on zooming and panning in on clip than this?

    http://www.youtube.com/watch?v=_0kt60VAyb8&feature=related
    This is sort of helpful, but despite over thre hours work, I cannot get my clip to do what I want.
    I need Video Tutorials, not text instruction. i'm dyslexic and simply see gobbldeegupe when looking at written instructions.
    Thanks, everyone.
    This is the clip in question...
    http://www.youtube.com/watch?v=t6LWzo5n_sg
    I want to zoom in to avoid seeing my lady at right of screen, who basically stopped acting in the scene.   The zoom in will be effective anyway, since we are zooming in on an annoyed man. The image would need to zoom in, but not the center of the image. So a pan up also needs to be applied.

    That Tutorial covers the basic mechanics of a Pan & Zoom with Keyframes on the Fixed Effects>Motion>Scale (Zoom) and Motion>Position (Pan).
    The next step is to learn about Interpolation in Keyframes, where one can adjust how things appear. The Keyframes, that the author used were Linear, so they start at full-speed and end at full-speed. Through Interpolation, one can adjust how the motions begin and end. The Help File covers Keyframe Interpolation ver well, and as there are quite a few choices, with different results, is important when one chooses to alter Interpolation.
    What aspects would you like more detail on?
    Only thing that I saw, that I would have included, would have been near the end, when the author click-drags on the last Keyframes, one at a time. That can be done, but one can also Lasso the Keyframes, and drag them all together. I'd have shown each way. I would also have shown the "scrubby" characteristic of the numerical coordinate box, as that can be useful too. Many operations in PrPro have more than one way to do things, and to cover each, does make a better tutorial.
    Let us know what else could/should be added, or where you are having an issue.
    Good luck,
    Hunt
    PS - rather than the graphical change in Position, that the author used, I usually rely on the numbers, but there is nothing wrong with the graphical method - just personal choice and how one likes to work.

Maybe you are looking for

  • Z table middleware replication from R/3 to CRM

    Looking for a CRM Middleware Guru out there !!! I'm trying to replicate a simple R/3 table (list of countries in my example below. The replication must include both initial and delta downloads. My problem is the following: When doing an initial load

  • Java applets and jsp

    I have an applet for example <applet height="50" width="500"  archive="applets.jar" codebase="applets/" code="MyApplet.class"  name="MyApplet">              <param name="param1" value="data1"/> </applet>I want the applet to manipulate the parameter p

  • Poor quality when exporting Explain Everything Video

    Hi There, I've created some videos in using the "Explain Everything" App on my iPad. When I save the videos to my iPad camera roll and play them back they look fantastic.  When I emailed the videos to myself and opened them up in my MacBook, the qual

  • Std Workflow Values in MM

    Hi MM Gurus Could any one share the Std Workflow Values available in MM. Ex: 9, 1, etc., and uses of the same Thanks

  • In XPath routing  system is showing the Target message type

    hi all, while givine XPath condition at receiver determination, it system is giving source structure, but i want to select field from target structure. Plz help me its very very urgen. POINTS will BE REWARDED. regards sreeni