File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes Scroll images Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Scroll images" Watch "Scroll images" New topic
Author

Scroll images

Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi everybody,
Is it possible to scroll images drawed with Canvas?
I received a image higher my screen, and I don't know how to scroll this image.
Thank you for your help
OULD


We are ones that build the world, thus build it well.
Christian Wolf
Greenhorn

Joined: Dec 15, 2003
Posts: 28
I received a image higher my screen, and I don't know how to scroll this image.
Use translate(0,y) to set the physical pixel point (0,0) to logical point (0,y). Then the canvas will start to draw at (nonexisting) physical point (0,-y) and you see the lower part of the image. Use the cursor keys to modify translation.
Christian Wolf
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
I agree with Christian. This is exactly what I do and it works well on Nokia phones. However, it assumes that phone always displays logic coord [0,0] at the upper left corner of the physical screen. The MIDP spec did not say how the phone should display Canvases lager than the physical screen. So, this bahvaior might not be portable? I'd like to hear people's experience on other devices. Thanks.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi Michael and Christian,
Thank you for your help. All is OK.
I could scroll my images thank to your advice.
No comment it works very well.
OULD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scroll images