Zooming capability of swing

Hello all,
Is there a way to zoom in and out on an image in a JFrame?? I did some research on this and still cannot find the answer. Hope you can help.
Thanks in advance,
=) Steven

Yes, you can use an AffineTransform or Image.getScaledInstance(width, height, scale_mode).
Robert Templeton

Similar Messages

  • I still do something wrong with Scrollpane and zoom capability

    Hi all!
    I thought I was successful in creating a working ScrollPane with centered zoom capability, but now I noticed that it doesn't work like it should, if the content node's PrefSize is larger then the scrollpane's size.
    The probleme is: if the contentNode is smaller then everything works how it should. The scrollbars update accordingly to the scale transformation. The scale transformation is applied to a node X and this node is a child of a flowPane node. The flowpane node ist the actual contentNode for the scrollpane.
    The node X has a changeListener for node.boundsInParent property and updates the flowpane's prefSize.
    Like I mentioned, everything works fine if the node and with that the flowpane's initial prefSize is at most same size like the scrollpane's.
    The probleme is that if the scaling is smaller than the scrollpane's size, the scrollbars don't update anymore, they keep the state for the initial prefSize of the flowpane While debugging I noticed that the actual size of the flowpane doesn't change if the changeListener sets the new prefSize to a down scaled size, smaller than the initial size (scalefactor = 1), but the prefSize of the flowpane changes if the scaled size is bigger then the initial size. And I think this behaviour of the flowpane ist stange (actually it is the same for stackpane and maybe for the other panes too).
    I couldn't find a way for the case that the initial contentNode is bigger than the scrollpane size.
    I didn't expect that implementing a scroll pane with zoom capability would be such a probleme. I really need a solution for this probleme.
    EDIT: Ok after a lot of testing I noticed, that StackPane and FlowPane behave like I had described it above, but Pane itself does behave like it should, at least how I would expect it. Now the probleme is, even if the Pane reduces its size and the scrollpane adaptes to it accordingly, the scale transformation is always centered and therefore the node with the transformation will be outside the Pane.
    It's like I never find a complete solution for my probleme. Everything I do has one fault.
    Thanks in advange.
    Edited by: user965407 on 25.12.2011 04:28

    ScrollPane documentation (http://docs.oracle.com/javafx/2.0/api/javafx/scene/control/ScrollPane.html) states:
    "If an application wants the scrolling to be based on the visual bounds of the node (for scaled content etc.), they need to wrap the scroll node in a Group."
    Not sure if that is what is causing your issues or not, but something to consider anyway.
    Also, you may want to try running and reviewing this example code (https://gist.github.com/1442298) for a centered node in a scrollpane with various effects and transformations (such as scaling) applied.

  • Does DW offer coding for zoom capability?

    At this address there's sophisticated zoom coding but it apparently only applies to wordpress documents (wpmu.org/magic-zoom-uses-fancy-javascript-to-zoom-images-on-your WordPress...).
    Does DW offer such capability?

    I upgraded DW to a test version of CS5.5. I downloaded the widget browser. I opened the jqzoom widget in the browser, which widget provides the zoom capability I'm seeking.
    I then created a test page, and copied the widget code onto the page, in its respective <head> and <body> sections. This includes the following code placed in the head section:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>jqzoom : Position- bottom 1</title>
    <script type='text/javascript' src='js/jquery-1.3.2.js'></script>
    <script type='text/javascript' src='js/jquery.jqzoom1.0.1.js'></script>
    <link type='text/css' href='css/jqzoom.css' rel='stylesheet'/>
    I then tried the zoom function. Nothing happened.
    In the CS5.5 split view, three 'tabs' (or 'separate elements' ???) appear among others, along the top of the page. These are: jquery-1.3.2.js, jquery-jqzoom1.0.1, and jqzoom.css. If I click on any of these 'elements' I get the message, that the element is "...not on the local disc." If I then click on the word "get" next to this statement, I get the message that element is, "...not in a defined site".
    So, while these 3 'elements' -at least the copied coding from the widget as noted above, are all within the <head>  section of this test document where it is said they should be, they're not "on the local disc" and/or not "in a defined site". So, what does this mean?
    This  jqzoom widget only includes two tabs: 'live view' and 'code'. My assumption is that I would just copy the code to the page, and that within CS5.5 the functionality of the copied code would be handled. Obviously, I'm wrong. What to do?

  • Using FlipView to create a PhotoViewer with pinch to zoom capability (like WP8 PhotoApp)

    Hello,
    I'm currently developing a Universial App using WinRT to develop for Windows 8.1 and WP8.1. Inside that app I want to view a couple of images. Viewing the images works just fine with a FlipView but the disadvantage is, you cannot zoom. I searched for a solution
    for several hours but I cannot manage to find something good.
    Most solutions say I should use a ScrollViewer but it seems that it cannot work fine with the flipView as I'm still able to switch the image while I have a zoomed image and thus the next image is also zoomed as well.
    The best solution I could manage to find is the MediaViewer Control but unfortunately it's written for WP8 Silverlight so I cannot use it directly. I tried to port it to WinRT but I failed because it's using a ViewportControl and there's no such control
    for WinRT, we only have a ViewBox but I don't know if it behaves like the ViewportControl and it's also lacking some methods which are used by the MediaViewer Control.
    Can someone help me building a control which supports zooming and switching images? My goal is to reach a similar behaviour as in the photo app for WP8, that means I'm completely able to switch images as long as the aren't zoomed. If the ZoomLevel is >
    1, then it should only be possible to pan the image but not trigger any item switch.
    Any help is greatly appreciated
    Regards

    It's been a while since you posted this and I only saw it by chance but here's your answer, hope you will see it :)
    In my current solution I'm still using a FlipView but I don't handle zoom events with a ScrollViewer. Instead I created a small control which is embedded in the FlipView as ItemTemplate so I can handle the pinch to zoom gesture. To prevent flipping the Images
    I used two events in my custom controls which are fired when zoom gestures happened so I can lock/unlock image flipping. The events are hooked on the page because there I determine if I should handle the Manipulation event to flip an image or not.
    It used quite a bit of time to get to that solution but it works really good. As said, one disadvantage is that you have to use an own FlipView and embed my control in it instead of using one ready to go control. Also, currently you lose that peeking feature
    which the FlipView has when you perform a drag but don't do it far enough to really switch the element but it's something which one could live with
    I hope I could help you even after some months have passed.

  • Mighty Mouse won't zoom?

    I am now onto my 3rd Mighty Mouse in 4 months and I am am having problems with this one as well. Each time the problems have been different, but always centred around the scroll button.
    This time round I can scroll, but have no zoom capability. No settings have been changed and the function has been working previously. I have checked system preferences and zoom is set with use of the ctrl button as normal, but nothing happens.
    Can anybody help? Does the fault actually lie within my Imac and the mice have been fine and something in there needs fixed or do I need yet another new Mighty Mouse (Wireless version).

    Hi tom101-
    You must clean it: How to clean your Mighty Mouse
    Luck-
    -DaddyPaycheck

  • Camera with no zoom.....

    Ok so i bought the iphone 3gs and i was wondering why hasn't apple added a zoom feature i mean this is the new iphone and it has a video camera and all this new stuff but no zoom i mean i've seen phones years old that have a zoom feature i know the camera isn't that good but it still has zoom. I love the new iphone but my only problem is with the camera i don't want to be all up in someone's face and take the picture thats not right i should be able to do this at a distance i'm not saying u should make a brand new iphone just to add this but make have a free app that makes the pictures look good and that we can zoom

    You don't expect digital zoom to have good picture quality. iPhone 3GS does not have optical zoom like some Japanese cell phone released back in 2004. There aren't many cell phones with optical zoom either. Optical zoom provides the best zooming capability. iPhone 3GS however, does have auto focus and that's the most important thing when you need to take picture of documents or close up macro images.
    If you want 3x or more optical zoom, I think you have to look somewhere else or just search online to purchase some external camera lens designed specially for iPhone.
    Something like that I think that's what you really want huh??
    http://www.stylehive.com/bookmark/iPhone-Camera-Lens--6x-Optical-Zoom-396635
    Message was edited by: squarejp

  • Zooming desktop pictures without "pixelating"?

    Greetings. I have a number of photos I downloaded that I want to use as desktop pictures. The photo size is 800 x 600 (pixels). The native screen resolution on my MacBook is 1280 x 800. When I set the picture in the "Desktop" system pref, I am not happy with the CENTERING option. But when I select the FILL SCREEN option the photos become all "pixelated" on the display (because, of course, they are not large enough to fill the screen at native resolution).
    Curiously though, when I set the same photos to display in the "Screen Saver" system pref, they zoom in WITHOUT ANY "PIXELATING!" Can anyone explain to me why the zoom effect in "Screen Saver" doesn't pixelate the photos, and is there anyway to tap into this zoom capability in the "Desktop" system pref to view smaller photos at full screen? Is there a third party utility that can do this?
    Thanks!

    Greetings. I found several "screen saver run as desktop picture" options (including a cool widget called "Desktopsaver Plus") that essentially accomplishes what I'm after.

  • EPub format and pinch-and-zoom

    Hello all,
      I'm curious if someone can tell me whether the pinch-and-zoom capability seen on the IPad is a function of the hardware, or is it something that needs to be dealt with in advance in the ePub document?
    I wouldn't mind having images that a reader could zoom in on and that would be nice and sharp at some high-level zoom, but don't know if, or how, I can ensure that my book images will be sharp throughout. Any ideas or info will be appreciated.
    -T

    I think it's hardware function. Email yourself a PDF or newsletter and go to an apple store and check your mail.

  • Isight with zoom or higher resolution

    i've noticed a lot of people inquire about lower priced camera options, i'd like to go in the other direction. is there a higher quality (yes, higher priced) camera for the mac that also has zoom capabilities (not digital zoom)?
    thank you,

    Hello window view,
    In answer to your question, a FW camcorder would give you what you ask; higher price tag(unless you already have one), possibly better picture quality and zoom capability.
    I've done both and the slight gain in picture, to me, was not worth the hassle of setting up and taking down the camcorder.
    Here is a link that makes a comparison to help you decide:
    http://homepage.mac.com/john_kenn/VideoBlog/C2113408171/E1899825018/index.html
    Respectfully,
    Bill Gallagher

  • Pinch zoom is often getting stuck and going to the full extent of zoom since Yosemite upgrade

    Are any other users experiencing an issue where pinch zooming is broke since upgrading to yosemite?  When I use the two-finger pinch zoom, the zooming often seems to get stuck and keeps going after I lift my fingers.  Whether zooming in or out, the zoom will often continue to the full extent of zoom capability in whichever direction it started.  Tapping on the trackpad while it is in runaway zoom has no effect and I just have to wait for it to finish, then resize things manually.  Is anyone else having this problem?  I did a fresh reinstall of Logic but that didn't help any.

    Are any other users experiencing an issue where pinch zooming is broke since upgrading to yosemite?  When I use the two-finger pinch zoom, the zooming often seems to get stuck and keeps going after I lift my fingers.  Whether zooming in or out, the zoom will often continue to the full extent of zoom capability in whichever direction it started.  Tapping on the trackpad while it is in runaway zoom has no effect and I just have to wait for it to finish, then resize things manually.  Is anyone else having this problem?  I did a fresh reinstall of Logic but that didn't help any.

  • No More Zoom on iPhone Camera?

    Since I last updated my iPhone software, my camera no longer has the zoom capability.
    I understand that this wasn't TRULY a zoom feature and that I can "zoom in and crop" in Photoshop once I download the photo.
    HOWEVER: The "zoom" ability used to help me SEE what I was focusing on. A great help especially if trying to capture a specific face in a crowded scene, for instance.
    Is there any hope that this feature will return?
    I actually DISLIKE the new features Apple has added to the camera capability. Now THERE is where I think they should have left it alone and allowed the user to do enhancing in Photoshop or in one of the dozens of apps out there that can accomplish this.

    "Pinch the screen."
    Well THAT worked!!
    Had never "pinched" before ... just tapped where I wanted to zoom in.
    At any rate, problem solved. THANK YOU!!

  • Camcorder and Zoom

    Camera zooms in and out just fine. Camcorder does not have any zoom capabilities. I was lead to believe that with froyo, the camcorder wil also have a zoom capability. Did I misunderstand or did it not just happen? Will the camcorder ever have zoom capabilities?

    Good Questions!  I think we would all like to see Video Zoom capability.
    Perhaps it has something to do with the fact that the Video ha been advertised as 720 P and that without Optical zoom capibility and using Digital Zoom they would be at something less then 720P in Zoom mode.

  • New for EchoSign: Deep Zoom

    I wanted to let you all know about some cool updates we’ve been making on EchoSign lately. One of the best is the new “Deep Zoom” capability.  This lets you read the fine print on contracts with incredible fidelity and visibility.   To geek-out a bit here, let me explain how this works.   When EchoSign was a startup, we used open source PDF rasterizers. These worked pretty well in terms of rendering and viewing PDF files. But it wasn’t the best in the industry. Now that EchoSign is part of Adobe, we were able to use the Native Rasterizers from the company that invented PDFs – Adobe. The result is massive performance gains (you should be noticing that EchoSign is like 15 – 20% faster these days) as well as Deep Zoom.
    More is coming.  Stay tuned for some exciting announcements at Dreamforce.

    How do you plan to "input the correct matching elements"?
    It's possible to create content in Flash and use it in
    Captivate as "animations" and widgets so I don't see why it
    couldn't be done.
    /Michael

  • Does the new iPad have video zoom?

    Does the new iPad have video zoom capability? I see the camera has it, but I cannot get the video to zoom in.

    This has been posted for quite some time - I cannot find anything on this.   I have an iphone and the video zoom works while record my kids events, but my iPad mini does not have this functionality????  Why?

  • Does Premier Pro CS5 have Pan & Zoom for VIDEO ?

    Have been looking for a straight answer on this and all I find is a bunch of stuff about still image effects in Premiere Pro using key frames.
    Just dropped a lot of coin on Master Collection CS5 and trapped for a time in Premier Pro CS4 because I now have to buy a new 64Bit platform; No matter because I'm really impressed with what Adobe is doing across the board. Lord knows I could be missing something right in front of me.
    The question here is will I find a standard pan and zoom capability - FOR VIDEO NOT IMAGES - in Premiere Pro CS5 when I finally spend ALL of my disposable income or should I just stick with my $100 Sony Vegas NLE on my 32Bit platform ;-)
    On a related note, how can you have a VIDEO editor of consequence without pan and zoom ? Am I the only one who find this curious ? Is this issue like the crazy aunt in the attic that no-one wants to talk about ?

    On a related note, how can you have a VIDEO editor of consequence without pan and zoom ? Am I the only one who find this curious ? Is this issue like the crazy aunt in the attic that no-one wants to talk about ?
    Look before you leap in with an ill informed opion. 
    A little more hands on time and maybe breaking out the help or manual files would have lead you to the discovery of what Colin pointed out.
    You will discover a world of power and tricks within the CS5 applications.  Not all are immediately evident but they become fundamental and instinctive after a bit of time.  Many of us can still be shown a trick or two after many years with the apps.  Colin B. is a source of many of them.

Maybe you are looking for

  • IPod no longer syncing

    Hello! I recently sent my iPod away to be fixed (side button broke off). Apple said it "could not reproduce my problem" and mailed me my original product back - after installing the latest OS (it says 4.1). Now I have a broken iPod that won't even sy

  • I did a force close on Safari and after rebooting my macbook pro, i no longer see the Safari icon on the dock.  How do i get i back?

    I did a force close on Safari and after rebooting my macbook pro, i no longer see the Safari icon on the dock.  How do i get i back?

  • Can't install a package [SOLVED]

    Hi folks ^^ I was trying to install python2-cssutils but pacman shows me the next error: python2-cssutils: /usr/bin/csscapture existe en el sistema de archivos python2-cssutils: /usr/bin/csscombine existe en el sistema de archivos python2-cssutils: /

  • Did anyone worked on integration Siebel 7.8 ecommunications with Oracle RTD

    Gurus, We are inprocess of implementing integration between Siebel eComunication Version 7.8.2.14 with Oracle RTD 2.2.1. As part of that we have imported all the SIA sifs related to 7.8 and all the .dat files, configuration defination (.def) files an

  • Monitor JMS Foreign Server

    Hi,           I have configured the IBM MQ server as a foreign server in one of the JMS Module of WLS9.1. I am able to identify it using JMX (MBeans).(I thought this was a good approach if u have any other approach for it? reply me).           Now i