How to drag an image around?

hi,
does anyone knows how to drag a image (.gif or .jpg picture) around inside a scrollPane?
i have tried to drag shapes (like rectangle) around and it works fine but not for a .gif picture,
so does anyone have any idea how to do so??
Thanks!!!!!

Hi,
You could solve it like this.
Draw the image on for example a (J)Component So make sure the component is of exact size as the image.
Add this component to some container (which uses a null layout), set the location of the component.
Then add a MouseMotionListener to this component and listen for the the events. This way by using the method: setLocation(Point x) on the component you can move the component around, so the image on the component can be moved.
I hope this helps you out.

Similar Messages

  • HT2506 How do I drag an image around in the view, once it's magnified larger than the viewing area? I can imagine a simple "hand" tool like in Adobe PDF Reader doing this, but it's oddly missing in this application, quite a shame.

    How do I drag an image around in the view, once it's magnified larger than the viewing area? I can imagine a simple "hand" tool like in Adobe PDF Reader doing this, but it's oddly missing in this application, quite a shame.

    @Csound1 how is my mac relevant? I'm talking about software not hardware.
    @Kurt Lang sorry, I composed the message when looking at "Preview" application help on this site, the fact that it missed the context here, is another issue I have with Apple's "famous" UI/UX design...
    So for the record, I'm talking about the "Preview" app that comes bundles with Max OSX.

  • How to wrap an image around a mug in Photoshop CS5?

    I have tried many things like transform -> warp or tried to play with 3D but nothing gave me an effect like this image. Does anyone know a good tutorial or would like to explain to me how to wrap an image around a mug and make it look realistic like this?

    For Photoshop Elements
    Step A
    Select the Type Tool, type in your text
    .. then look at the top of the
    page
    You will see an arc with a T over it
    Click on that and you will be
    able to curve the text
    Step B
    There are 3 items to consider in order for this project to come out
    satisfactorily.
    A. The picture of the coffee mug needs to be properly
    sized, and enhanced
    B. Directions for the text above
    C. The picture for application to the mug needs to be
    configured so that its curvature conforms. I shall give you directions, but the
    values may require adjustment for your particular picture:
    Duplicate background layer, and shut off visibility by clicking on its eye
    icon
    Increase canvas size Image>resize>canvas
    size. Uncheck relative. Enter new values for width & height. Try 120% (+/-).
    You need more "real estate" for the next steps. The checkerboard pattern denotes
    transparency, which you want all around.
    Rotate picture. Image>rotate>layer, 90
    degrees right
    Filter>distort>spherize. Set mode to vertical only. Amount 100%
    Filter>distort>shear. Click center of control line, grab this center
    handle, and pull just a little to left
    Rotate picture back. Image>rotate>layer>90 degrees left
    Copy to clipboard, paste on picture of mug. Position and adjust size with
    move tool.
    Edit: Resolution of picture of mug and of picture to be applied should be about
    the same number. You can check this in Image>resize>picture size before you embark on
    above.

  • CS5 - how to drag in images from a browser easily?

    In previous version (on the PC anyway) you caould literally drag an imaeg from a web browser right into a blank spot in photoshop and it would immedietly become available to work on. 
    This saved me tons of time (right click imaeg, save to desktop, go to photoshop, open, select image, etc) ...was all done instantly.
    With just a little experience using CS5 under my belt, it seems as if I can't get this to work anymore.  Perhaps it's my ignorance with the MAC OS (I'm new to it), or I need a different browser, etc.
    Anyone know how to drag and drop images from the web (browser), directly into Photoshop (CS5)? I'm using a new MacBook Pro 13"

    I see.  I am used to doing that, then moving the image up into the workspace and dropping it.  This is actually a small step easier... and it worked!
    Thanks for the tip.

  • How to drag an image on to a blank page?

    How does one drag an image on to a blank page? 
    Message title was edited by: Brett N

    You should be able to drag an open image from the photo bin to the work area.
    If that does not work for you, try :
    Go to File>new>blank file
    Open your image
    Go to Select>all
    Go to Edit>copy
    Go back to the blank file
    Go to Edit>paste

  • How to wrap an image around a rectangular box?

    How do I wrap an image such as this: around the outside of a rectangular box such as this: in photoshop (creative cloud). Step-by-step instructions would be greatly appreciated. Thanks.

    Even with the vanishing point tool you're still going to have to do quite a bit of artistry to deal with masking and shading to make it look even remotely like a box.  Not to mention the rounded corners and incuts.  There's no automated way of doing this, it's purely transforming, cutting, pasting, and shading layers; good ole standard photoshop.  I'd think it'd almost be easier to design a box as a 3D model and apply that texture to it.

  • How to Drag a image from a folder and drop it into Photoshop, InDesign using keyboard?

    Hi!
    Others may think silly about this question but the reality is I have to drag and drop several images into InDesign from a folder each one by one. Is it possible to drag and drop images from desktop (folder) to Adobe InDesign, Photoshop, etc?
    Thanks!
    Hope a positive reply.

    Thanks Peter/Jongware
    I searched Google and found the link below but became unable to use 'drag and drop'
    http://www.knowledgesutra.com/forums/Keyboard-Mouse-t49017.html
    I'm using Windows 7 Ultimate.
    Thanks.

  • How do I turn off preview of hidden areas when dragging an image in frame with Direct Select Tool?

    CS5, Not sure how to word this...
    In previous version of ID, if I had a graphic in a frame, I could drag the image around inside that frame with the Direct Selection Tool.  I can still do this with CS5 but it seems to want to show the entire image in a ghosting way that is outside of the frame.  Is there a way to turn this preview type look off like it was in previous versions?  I feel like its slowing my computer down bigtime because I am dealing with a large image.  Everytime I click to drag it, everything slows to a crawl and unusable.

    Go to the Prefernces and set Live Screen Drawing to Delayed.

  • Since updating to Firefox 36.0, I can't drag images around (for a Google reverse image search) - is it working as intended?

    Earlier today, before updating the browser, I could drag the images around, to a new tab, where I'd throw them in Google, an essential asset for my work - getting visually similar references. Since the last update, I can't.
    Is this how it's going to work from now on? I abhor the idea of switching browsers, but if i can't do that in FF36.0, I can't work with it.

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that temporarily turns off hardware acceleration, resets some settings, and disables add-ons (extensions and themes).
    '''If Firefox is open,''' you can restart in Firefox Safe Mode from the Help menu:
    * Click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    '''If Firefox is not running,''' you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".
    ;[[Image:SafeMode-Fx35]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, theme, or hardware acceleration. Please follow the steps in the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • How do I drag an image icon or image from one panel to another panel?

    Please help.
    I know to need how to drag an image icon from one panel to the other. For example, the first panel would shows the image files that is inside my folder. How can i code it so that I can drag the image that appear on the first panel into the second panel which will hold the images that I want to embed my barcode inside?
    The thumbnail size of the image and showing all the image files in my folder was done already, I only need to know how can I make the image icon to be able to drag from one panel to the other.
    Thanks.

    I found this code in some websites:
    public class ImageSelection extends TransferHandler {
         private static final DataFlavor flavors[] = {DataFlavor.imageFlavor};
         public int getSourceActions(JComponent c) {
              return TransferHandler.COPY;
         public boolean canImport(JComponent comp, DataFlavor flavor[]){
              if (!(comp instanceof JLabel)){
                   return false;
              for (int i=0, n=flavor.length; i<n; i++){
                   for (int j=0, m=flavors.length; j<m; j++){
                        if (flavor.equals(flavors[j])){
                             return true;
              return false;
         public Transferable createTransferable(JComponent comp) {
              if (comp instanceof JLabel) {
                   JLabel label = (JLabel)comp;
                   Icon icon = label.getIcon();
                   if (icon instanceof ImageIcon){
                        final Image image = ((ImageIcon)icon).getImage();
                        final JLabel source = label;
                        Transferable transferable = new Transferable(){
                             public Object getTransferData(DataFlavor flavor){
                                  if (isDataFlavorSupported(flavor)){
                                       return image;
                                  return null;
                             public DataFlavor[] getTransferDataFlavors(){
                                  return flavors;
                             public boolean isDataFlavorSupported(DataFlavor flavor){
                                  return flavor.equals(DataFlavor.imageFlavor);
                        return transferable;
              return null;
         public boolean importData(JComponent comp, Transferable t){
              if (comp instanceof JLabel){
                   JLabel label = (JLabel)comp;
                   if (t.isDataFlavorSupported(flavors[0])){
                        try {
                             Image image = (Image)t.getTransferData(flavors[0]);
                             ImageIcon icon = new ImageIcon(image);
                             label.setIcon(icon);
                             return true;
                        catch (UnsupportedFlavorException ignored){
                        catch (IOException ignored) {
              return false;
    What this codes does is to get the image from the imageicon and replace the image to the imageicon that you drag the source from. However, I had no clue how I can get the source's file name. Anyone can teach me how?
    Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to reposition an image in Pages 5.0?

    I have to say that the new Pages 5.0 UI takes some getting used to. Familiar features are in a different location and sometimes don't work the way I expect them to. "Object" support is particularly perplexing. I had no problem positioning images (primarily photos) exactly how I wanted them in the previous version. In this new version, the Move with Text panel just doesn't seen to work like I expect. Specifially, choosing Text Wrap - Above and Below shows an insertion point in the document. In the previous version, I could drag the image around to move the insertion point exactly where I wanted it. In 5.0 that doesn't seem to work. Pages 5.0 Help says "
    Reposition an object anchored to text
    An object anchored to text has an anchored object marker that indicates the text it’s associated with.
    Drag the object or its marker to the text you want to associate the object with
    But the marker does not move when I drag the image and there doesn't seem to be a way to click on and drag the marker itself. Anyone else having issues or have a solution?
    thanks,
    Michael

    I also wanted to use the text wrap: "above and below" option with setting the marker at a specific position, but I found no way at all to select and move the marker. The Help seems to suggest that you should be able to do it.
    I would argue this is a bug.
    You are right that "Inline with text" seems to be the best option if you want to place images that move with the text.

  • How to drag and drop a picture at run time in a window displaying pictures?

    How to drag and drop a picture at run time in a window displaying pictures on the front panel. The main thing is that the window is displaying frames continuously?

    vivman,
    So from your description you have a picture control where you've already created an image and you'd like to drag an image around inside of the picture control. This can be done although it is going to take a significant amount of research and programming on your behalf. You can use the drag event in the event handler to find out when the drag occurs and where the cursor is. Then edit the picture as you move your mouse so that when you drop the picture gets updated.
    The even structure is a somewhat advanced topic and the drag and drop feature is one of the more advanced uses of this structure. I would search the example finder (help>>find examples) for "event" and "drag" to see how to use these events. Also you'll want to look at the examples for the picture control.
    Sounds like a cool project! Check out Darren's Weekly Nugget 10/30/2006 this topic (http://forums.ni.com/ni/board/message?board.id=170&message.id=212920). It might prove useful.
    Good luck!
    Chris C
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect

  • Flip an Image around center

    How to flip an image around center and then copy the bitmap data to another image??

    Hi,
    in Preview use the menu - -
    Tools > flip horizontal
                     Vertical

  • How do I drag an image or text box to the "workspace" off of my working file but where I can still see the image and text box for future use?

    How do I drag an image or text box to the "workspace" off of my working file but where I can still see the image and text box for future use?
    When I drag the item off of the trifold that I am creating, it just disappears but I still want to use it.  I just need to move it out of the way to modify other portions of the document.
    thanks,
    C

    Add another page below the current one to use as a storage area. You can't use the grey area around the page for storing items you want to use later.
    Go to the Pages Menu>Provide Pages Feedback if you would like to request this feature be added in future versions.

  • How do I drag simultaneously mulitple images viewed in Preview to Finder. I know how to do one image at a time by dragging

    How do I drag multiple images simultaneously from Preview to Finder. I know how to do one at a time. However since I typically shoot at 12 frames per second, sports photography, I have a lot of images to move of one athlete while in motion.

    (A personal footnote):
    Why are you using Preview at all? I hardly ever use it for anything, finding it very limited.
    I am only an amateur photographer, but I much prefer GraphicConverter which, for example, in batch mode would do much of what you ask.
    IMO it is probably the best shareware application ever written for the Mac.
    If you don't know it, give it a try:
    http://www.lemkesoft.com/content/188/graphicconverter.html

Maybe you are looking for

  • IDE #0 Error on Satellite Pro A10

    We have a Sat Pro A10 which shows the following errpr on boot; IDE #0 Error. The bios is not showing a hard drive. Have tried a new hard drive, same error

  • Swf works with errors but how hide them from browser?

    Hi! I've made an AS3 application loading and manipulating some XML data. The application works but there are some errors in the Output panel I'm unable to get rid of. But when I publish to HTML they also show up in FireFox. How can I flag them as non

  • Print Shot List in iMovie (10.0.5)

    Is there a way to print the Shot List for a trailer in iMovie (10.0.5)? It was an option in iMovie '11 but it looks like the ability to print has been removed from iMovie.

  • Why no PDF viewer for Firefox4 for Mac?

    I used to use the PDF viewing plug-in with Firefox 3.X but it seems there is no similar plug-in available for 4.X. Am I missing something? I tried downloading OpenIT, but it was truly awful. Why is Firefox so far behind on such a basic yet essential

  • Ms CRM 2013 Autosave loop in quote form.

    Hi Everyone, I have problem with autosave feature. I disabled this feature but in quote form when im triying to add quoteitem from quotedetailsGrid, form trying to save item. And never stop. I cant enter my quoteitem's name or discount because form t