File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scroll images

 
Ould Nadif
Ranch Hand
Posts: 184
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christian Wolf
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1427
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ould Nadif
Ranch Hand
Posts: 184
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic