Question of zoom in/out and draw on the same  area

HI Folks,
The goal I like to achieve is.
(a) Draw a rectangle on an image by dragging the mouse.
(b) Release the mouse and then click on any point inside the rectangle to
select the region inside the rectangle.
(c) Zoom in: draw the selected region onto the same drawing area as the original (the same) one, that is, replace the original image with its selected region.
I have coded up (a). Would anyone tell me how to code up (b) and (c), best if show me show code snippets.
Thank you very much in advance.
Cheers!

Hi,
you should make "selection objects" which represent your rect.s.
they could have a drawMe(Rectangle source, Rectangle dest) method which would be called in the rendering loop. While source represents the selected area of the orignal image and dest the destination aera which drawMe would actually draw the image into.
Source would get set on mouse up after dragging, dest would be set after the click equal to your drawing area.
I'm not sure about the actual image scaling but i think it can be done similar like that: http://www.rgagnon.com/javadetails/java-0243.html.
You dhould definately have a look at javax.imageio.*;just some ideas
jEti

Similar Messages

  • My iPod generation 6 160gb will not sync. iTunes says corrupt, won't restore just errors out and then loops the same messages.

    My iPod is corrupt according to iTunes, however it won't restore through iTunes either.  I've tried to reformat the drive.  Makes no difference.  I've tried to reformat after choosing disk manager, and again the same result.  The iPod takes forever to work through the reformatting process and I get the same message "Itunes has detected an iPod that appears to be corrupted. You may need to restore this iPod before it can be used with iTunes. You may also try disconnecting and reconnecting the iPod" and then my pc tells me to format the disk.
    It's so frustrating, is there a fix to this? It seems like the iPod could still function, but I'm missing the way to get out of this loop, please help me!

    Likely a hard drive fault, see the note that i wrote few years ago, hopefully it helps
    If a sad iPod icon or an exclamation point and folder icon appears on your iPod’s screen, or with sounds of clicking or HD whirring, it is usually the sign of a hard drive problem and you have the power to do something about it now. Your silver bullet of resolving your iPod issue – is to restore your iPod to factory settings.
    http://docs.info.apple.com/article.html?artnum=60983
    If you're having trouble, try these steps at different levels one at a time until the issue is resolved. These steps will often whip your iPod back into shape.
    Make sure you do all the following “TRYs”
    A. Try to wait 30 minutes while iPod is charging.
    B. Try another FireWire or USB through Dock Connector cable.
    C. Try another FireWire or USB port on your computer .
    D. Try to disconnect all devices from your computer's FireWire and USB ports.
    E. Try to download and install the latest version of iPod software and iTunes
    http://www.apple.com/itunes/download/
    For old and other versions of iPod updater for window you can get here
    http://www.ipodwizard.net/showthread.php?t=7369
    F. Try these five steps (known as the five Rs) and it would conquer most iPod issues.
    http://www.apple.com/support/ipod/five_rs/
    G. Try to put the iPod into Disk Mode if it fails to appear on the desktop
    http://docs.info.apple.com/article.html?artnum=93651
    If none of these steps address the issue, you may need to go to Intermediate level listed below in logical order. Check from the top of the lists to see if that is what keeping iPod from appearing on your computer in order for doing the Restore.
    Intermediate Level
    A. Try to connect your iPod with another computer with the iPod updater pre-installed.
    B. Still can’t see your iPod, put it in Disk Mode and connect with a computer, instead of doing a Restore on iPod Updater. Go and format the iPod instead.
    For Mac computer
    1. Open the disk utility, hope your iPod appears there (left hand side), highlight it
    2. Go to Tab “Partition”, click either “Delete” or “Partition”, if fails, skip this step and go to 3
    3. Go to Tab “Erase” , choose Volume Format as “MAC OS Extended (Journaled), and click Erase, again if fails, skip it and go to 4
    4. Same as step 3, but open the “Security Options....” and choose “Zero Out Data” before click Erase. It will take 1 to 2 hours to complete.
    5. Eject your iPod and do a Reset
    6. Open the iTunes 7 and click “Restore”
    For Window computer
    Go to folder “My Computer”
    Hope you can see your iPod there and right click on the iPod
    Choose “Format”. Ensure the settings are at “Default” and that “Quick Format” is not checked
    Now select “Format”
    Eject your iPod and do a Reset
    Open the iTunes 7 and click “Restore”
    In case you do not manage to do a “Format” on a window computer, try to use some 3rd party disk utility software, e.g.“HP USB Disk Storage Format Tool”.
    http://discussions.apple.com/thread.jspa?threadID=501330&tstart=0
    C. Windows users having trouble with their iPods should locate a Mac user. In many cases when an iPod won't show up on a PC that it will show up on the Mac. Then it can be restored. When the PC user returns to his computer the iPod will be recognized by the PC, reformatted for the PC, and usable again. By the way, it works in reverse too. A Mac user often can get his iPod back by connecting it to a PC and restoring it.
    Tips
    a. It does not matter whether the format is completed or not, the key is to erase (or partly) the corrupted firmware files on the Hard Drive of the iPod. After that, when the iPod re-connected with a computer, it will be recognized as an fresh external hard drive, it will show up on the iTunes 7.
    b. It is not a difficult issue for a Mac user to find a window base computer, for a PC user, if they can’t find any Mac user, they can go to a nearest Apple Shop for a favor.
    c. You may need to switch around the PC and Mac, try to do several attempts between “Format” and “Restore”
    http://discussions.apple.com/thread.jspa?messageID=2364921&#2364921
    Advance Level
    A. Diagnostic mode solution
    If you have tried trouble shooting your iPod to no avail after all the steps above, chances are your iPod has a hardware problem. The iPod's built-in Diagnostic Mode is a quick and easy way to determine if you have a "bad" iPod.
    You need to restart your iPod before putting it into Diagnostic Mode. Check that your hold switch is off by sliding the switch away from the headphone jack. Toggle it on and off to be safe.
    Press and hold the following combination of buttons simultaneously for approximately 10 seconds to reset the iPod.
    iPod 1G to 3G: "Menu" and "Play/Pause"
    iPod 4G+ (includes Photo, Nano, Video, and Mini): "Menu" and "Select"
    The Apple logo will appear and you should feel the hard drive spinning up. Press and hold the following sequence of buttons:
    iPod 1G to 3G: "REW", "FFW" and "Select"
    iPod 4G+ (includes Photo, Nano, Video, and Mini): "Back" and "Select"
    You will hear an audible chirp sound (3G models and higher) and the Apple logo should appear backwards. You are now in Diagnostic Mode. Navigate the list of tests using "REW" and "FFW". The scroll wheel will not function while in diagnostic mode. For further details on Diagnostic mode can be found at http://www.methodshop.com/mp3/ipodsupport/diagnosticmode/
    Try to do the 5in1, HDD R/W and HDD scan tests. Some successful cases have been reported after the running the few tests under the Diagnostic mode. In case it does not work in your case, and the scan tests reports show some errors then it proves your iPod has a hardware problem and it needs a repairing service.
    B. Format your iPod with a start disk
    I have not tried this solution myself, I heard that there were few successful cases that the users managed to get their iPod (you must put your iPod in disk mode before connecting with a computer) mounted by the computer, which was booted by a system startup disk. For Mac, you can use the Disk Utility (on the Tiger OS system disk), for PC user, you can use the window OS system disk. Try to find a way to reformat your iPod, again it does not matter which format (FAT32, NTFS or HFS+) you choose, the key is to erase the corrupted system files on the iPod. Then eject your iPod and do a Reset to switch out from Disk Mode. Reboot your computer at the normal way, connect your iPod back with it, open the iPod updater, and hopefully your iPod will appear there for the Restore.
    If none of these steps address the issue, your iPod may need to be repaired.
    Consider setting up a mail-in repair for your iPod http://depot.info.apple.com/ipod/
    Or visit your local Apple Retail Store http://www.apple.com/retail/
    In case your iPod is no longer covered by the warranty and you want to find a second repairing company, you can try iPodResQ or ifixit at your own risk
    http://www.ipodresq.com/index.php
    http://www.ifixit.com/
    Just in case that you are at the following situation
    Your iPod warranty is expired
    You don’t want to pay any service charges
    You are prepared to buy a new one
    You can’t accept the re-sell value of your broken iPod
    Rather than leave your iPod as paper-weight or throw it away.
    You can try the following, but again, only do it as your last resort and at your own risk.
    Warning !!!! – It may or may not manage to solve your problem, and with a risk that you may further damage your iPod, which end up as an expensive paper weight or you need to pay more higher repairing cost. Therefore, please re-consider again whether you want to try the next level
    Last Resort Level
    1. . Disconnecting the Hard Drive and battery inside the iPod – Warning !! Your iPod warranty will be waived once you open the iPod.
    In Hong Kong there are some electronic shops offering an iPod service for Sad iPod, the first thing they do is to open up the iPod’s case and disconnecting the battery and the Hard Drive from the main board of the iPod. Wait for 5-10 minutes and reconnecting them back. The reason behind which I can think of is to do a fully reset of a processor of the iPod. In case you want do it itself and you believe that you are good on fixing the electronics devices and have experience to deal with small bits of electronic parts, then you can read the following of how to open the iPod case for battery and HDD replacement (with Quicktimes)
    http://eshop.macsales.com/tech_center/index.cfm?page=Video/directory.html
    2.Press the reset button on the Hard Drive inside the iPod – Suggestion from Kill8joy
    http://discussions.apple.com/thread.jspa?messageID=2438774#2438774
    Have I tried these myself? No, I am afraid to do it myself as I am squeamish about tinkering inside electronic devices, I have few experiences that either I broke the parts (which are normally tiny or fragile) or failed to put the parts back to the main case. Therefore, I agree with suggestion to have it fixed by a Pro.
    2. Do a search on Google and some topics on this discussion forum about “Sad iPod”
    Exclamation point and folder and nothing else
    Spank your iPod
    http://www.youtube.com/watch?v=3ljPhrFUaOY
    http://discussions.apple.com/thread.jspa?messageID=3597173#3597173
    Exclamation point and folder and nothing else
    http://discussions.apple.com/thread.jspa?messageID=2831962#2831962
    What should I do with my iPod? Send it or keep it?
    http://discussions.apple.com/thread.jspa?threadID=469080&tstart=0
    Strange error on iPod (probably death)
    http://discussions.apple.com/thread.jspa?threadID=435160&start=0&tstart=0
    Sad Face on iPod for no apparent reason
    http://discussions.apple.com/thread.jspa?threadID=336342&start=0&tstart=0
    Meeting the Sad iPod icon
    http://askpang.typepad.com/relevant_history/2004/11/meeting_the_sad.html#comment -10519524
    Sad faced iPod, but my computer won’t recognize it?
    http://discussions.apple.com/thread.jspa?messageID=2236095#2236095
    iPod Photo: unhappy icon + warranty question
    http://discussions.apple.com/thread.jspa?messageID=2233746#2233746
    4th Gen iPod Users - are we all having the same problem?
    http://discussions.apple.com/message.jspa?messageID=2235623#2235623
    Low Battery, and clicking sounds
    http://discussions.apple.com/thread.jspa?messageID=2237714#2237714
    Sad faced iPod, but my computer won’t recognize it
    http://discussions.apple.com/thread.jspa?messageID=2242018#2242018
    Sad iPod solution
    http://discussions.apple.com/thread.jspa?threadID=412033&tstart=0
    Re: try to restore ipod and it says "can't mount ipod"
    http://discussions.apple.com/thread.jspa?threadID=443659&tstart=30
    iPod making clicking noise and is frozen
    http://discussions.apple.com/thread.jspa?messageID=2420150#2420150
    Cant put it into disk mode
    http://discussions.apple.com/thread.jspa?messageID=3786084#3786084
    I think my iPod just died its final death
    http://discussions.apple.com/thread.jspa?messageID=3813051
    Apple logo & monochrome battery stay
    http://discussions.apple.com/thread.jspa?messageID=3827167#3827167
    My iPod ism’t resetting and isn’t being read by my computer
    http://discussions.apple.com/thread.jspa?messageID=4489387#4489387
    I am not suggesting that you should follow as well, but just read them as your reference. You are the person to make the call.
    Finally, I read a fair comments from dwb, regarding of slapping the back of the iPod multiple times
    Quote “This has been discussed numerous times as a 'fix'. It does work, at least for a while. In fact I remember using the same basic trick to revive Seagate and Quantam drives back in the mid to late 1980's. Why these tiny hard drives go bad I don't know - could be the actuator gets stuck in place or misaligned. Could be the platter gets stuck or the motor gets stuck. 'Stiction' was a problem for drives back in the 80's. Unfortunately the fix can cause damage to the platter so we temporarily fix one problem by creating another. But I know of two instances where a little slap onto the table revived the iPods and they are still worked a year or more later.”UnQuote

  • Using Digital Out and Speakers at the same time.

    I was under the assumption that pluging headphones or the fiber-optic cable into the audio out jack switched the internal speakers off; i.e. it was done in hardware. I just realized this can't be true since you get the start-up tone out of the internal speakers even when something is plugged into the Audio Output jack. Apparently the switching is done in software and not hardware. If this is true, does anyone know how I can setup my iMac so that the internal speakers are active even when something is plugged into the jack. As it is now, you can't even configure the internal speakers as long as the jack is in use.
     20" Intel iMac (2.0GB RAM, 500GB HD + 1.5TB external, 20" Cineama Display)   Mac OS X (10.4.7)   All tools, no talent!

    bump?

  • Zoom in-out and rotation in trackpad

    Zoom in-out and rotation in trackpad doesn't work in iPhoto, Aperture, Preview, Finder. Any solution?
    It works perfect at safari

    What context in the Finder would you expect zoom to work?  same question for rotate?
    I am able to see rotate and zoom working in iPhoto and Preview.  I do not have Aperture so I cannot check.

  • Zoom in-out and rotation in trackpad doesn't work in iPhoto and Aperture. Any solution?

    Zoom in-out and rotation in trackpad doesn't work in iPhoto and Aperture. Any solution?

    Sound like a trackpad problem and not an iPhoto one.  Have you asked in the forum dedicated to the Mac model you're using or is this an add on trackpad?
    OT

  • How to make the zoom in/out scale appear in the media browser ?

    How to make the zoom in/out scale appear in the media browser ? My videos only appear as a file list (only the names) and the zoom in/out device is currently not in the media browser...

    I meant that there is no "Icon mode" button or "List mode" button in my media browser. How to make them appear ?

  • HT4623 Hi, Im using an iPhone 4 8gb and recently updated my software using my computer to iOS 6.1.3 and some of the tabs are now grayed out and cant function (specific reference to "Show My Caller ID - On/Off tab").  is there a way to fix this or can i do

    Hi, Im using an iPhone 4 8gb and recently updated my software using my computer to iOS 6.1.3 and some of the tabs are now grayed out and cant function (specific reference to "Show My Caller ID - On/Off tab").  is there a way to fix this or can i downgrade back to my default software?

    Hi imobl,
    Thanks for your response, I forgot to add that the five 3uk sims we have in use, I have tried all of them none of them are recongnised non of them have pin codes, I even purchased four more sims Tmobile (original carrier) Vodaphone, 3 and giffgaff.

  • Opening a new file in photoshopcc and the file name is displayed but no white working canvas. you can see it as a layer in the layers panel and if i draw on the grey area i can see int on the layer but not on the main screen.

    opening a new file in photoshop cc and the file name is displayed but no white working canvas. you can see it as a layer in the layers panel and if i draw on the grey area i can see int on the layer but not on the main screen.

    Graphics card is the problem.
    Trying to update drivers now.
    Thanks for your help
    john

  • Why do I get the error saying my session has timed out and to start the operation again from the beginning when trying to instal lion

    I've purchased Lion from the app store and successfully installed it on three computers...however, now I'm receiving an error saying my session has timed out and to start the operation from the beginning???  Help..Thanks

    This is asked and answered mnay times every day.  The forum search abr is on the right side of this page.
    Disable your firewall/security software.

  • TS1277 it says apple mobile device fails to start i do not have sufficient priveledges..... this was after i updated my i tunes so i unistalled i tunes and reinstalled but the same question  persists

    it says apple mobile device fails to start i do not have sufficient priveledges..... this was after i updated my i tunes so i unistalled i tunes and reinstalled but the same question  persists

    Hi annibu757,
    If you are having issues with iTunes after an attempted update, you may find the following article helpful:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Regards,
    - Brenden

  • When you sighn in and out of an ios device some of the data fom the device sighned in stays after sighning out. Is this the same for PC and if so how do you delete all the data from my icloud from the pc

    When sighning in and out of an ios device some of the icloud data from the icloud account used to sighned in stays even after sighning out. Is it the same on pc icloud and if so how do you delete it. ( This is the online site by the way.)

    Hi turintest2
    Thanks for taking the time to respond - however your reply didn't really help as you haven't explained how to delete the compilation album that had been created.
    I managed to sort it out by doing the following (I'm posting this so that it may help others).  I don't know if this is the simplest/most elegant solution - but it works.
    In iTunes, find the compilation (in my case, the 153 songs) and, starting with the first song, follow this procedure:
    On the iPhone go to 'Songs' and scroll down the list until you find the first song that was listed in iTunes (above).  You should notice (as in my case) that the song will have the correct title (and artwork too if you'd found this previously before making the compliation) but the wring artist.
    Swipe LEFT and press the 'Delete' button.
    Repeat with second song in iTunes list, deleting the individual songs from the iPhone, one by one.
    Although tedious, this seemed to work for me.  Reason for doing down the iTunes list is that it is in a pseudo-alphabetical order and I wanted to make sure I'd got every one.
    Now busy re-importing the original albums from CD.
    Thank you APPLE for making this such a laborious process.  Why can't designers actually TEST the products they design so that they can appreciate first-hand the likely problems?
    Anyhow, thanks turintest2 for trying to help me - it was appreciated.
    RB

  • How can I embed a form on my website and set up a submit button so that when people fill out and click Submit, the filled form will be emailed to me as an attached pdf file?

    How can I embed a form on my website and set up a submit button so that when people fill out and click Submit, the filled form will be emailed to me as an attached pdf file?
    Thank you!

    Hi;
    That is not a workflow that is supported by the Adobe forms solutions at this time.
    Thanks,
    Josh

  • When i was waiting for an hour for itunes to grading my 2nd generation ipod touch to a 4.2.1 and it was about done, it suddenly said the network connection timed out and that made the upgrading a fail. Why does it do that? and what does it mean?

    When i was waiting for an hour for itunes to grading my 2nd generation ipod touch to a 4.2.1 and it was about done, it suddenly said the network connection timed out and that made the upgrading a fail. Why does it do that? and what does it mean?

    Error -3259 is a network timeout error, usually. This article might help:
    http://support.apple.com/kb/TS2799

  • I'm using aperture 3 and mobile me to set up galleries which I send to friends. My question. Will icloud allow me to do the same or will i lose this function when mobile me closes down in July.

    I'm using aperture 3/mobile me to set up photo galleries which I send to friends. My question. Will icloud allow me to do the same or will I lose this function when mobile me closes down in July. If this function isn't part of icloud does anybody have any suggestions how I can do this in future through aperature. Thank you 

    You will have to find a new hosting service for your galleries, when MM is gone; but you will still be able to create the galleries with Aperture. Export them to your disk and upload them via FTP to your new hosting service.
    See these support articles: Migrating from Mobile Me
    http://www.wilmut.webspace.virginmedia.com/notes/migrate/frommobileme3.html
    and this FAQ about Mobile Me and iCloud Transition http://support.apple.com/kb/HT4597

  • TS2771 Help! I just restored my ipod touch 2nd gen cos I needed a clear out. I went to sync some music back on, and it seemed to work. However when I went into 'music' it said 'no content'. I tried syncing music 3 times and it did the same every time. Hel

    Help! I just restored my ipod touch 2nd gen cos I needed a clear out. I went to sync some music back on, and it seemed to work. However when I went into 'music' it said 'no content'. I tried syncing music 3 times and it did the same every time. Help!

    Try plugging your ipod into your computer. Then start up itunes. Let it load everything. Then click on your ipod and play a song from your ipod's library. Not your itunes library. If it plays the song, then go ahead and stop it, disconnect your ipod, and check the content once again.
    I had the same problem and beleive it or not, this worked. I synced my ipod like 5 times before finding this answer on the web. Let me know if I need to clerify anything.

Maybe you are looking for