File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Zoom with wheel and cut picture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Zoom with wheel and cut picture" Watch "Zoom with wheel and cut picture" New topic
Author

Zoom with wheel and cut picture

Sylvain Prodo
Greenhorn

Joined: Feb 26, 2009
Posts: 15
Hi!
The following code should permitt to move a big picture (eg: 20 000 x 20 000 and 10 MO ) by drag and drop or with arrows of the keyboard, to zoom in and zoom out whith wheel of the mouse. there are some problems:
_arrows zoom ! 8-| instead of move the picture (what I have made wrong?)
_when dragging and droping we can see that picture is cut: we can't see the whole image, but only the part of the picture initially present on the main Frame, others parts are white
_the zoom with the mouse enlarge the high left corner of the picture... :-(
_I've try to place some panels, but they don't appear on the Frame: there is only the picture...
If somebody can help me...
thanks




---------------------------------
New beginner in java...
Bartek Myszkowski
Ranch Hand

Joined: Feb 03, 2009
Posts: 44
OK, I understand that You don't want scrolbars but I still think that JScrollPane is the best solution for this. You can hide scrollbars withand there won't be any scrollbar. After this You should make some kind of connection between Your drag&drop function and viewport of scrollpane.. and again I post this link
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Zoom with wheel and cut picture