This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Canvas re sizing and repainting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Canvas re sizing and repainting" Watch "Canvas re sizing and repainting" New topic
Author

Canvas re sizing and repainting

Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
Hi all, i am developing an application which displays non english characters using an image. The repaint is done only to the part of the canvas, so that the existing characters drawn earlier remain to unchanged. Some times the existing characters gets cleared, but thats some times, any idea why this is happening. My second question is how can i make the canvas bigger once it exceeds the size of the display so that the user can scroll down and continue typing? Thanks alot in advance. Anticipating a quick reply...


SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Eduardo Marques
Ranch Hand

Joined: Feb 19, 2005
Posts: 231
Maybe you could consider using the LayerManager
in the MIDP Game classes. It allows you to set a view port
over an area that may be bigger than the screen.

You can define a Sprite from an image and then add it
to a LayerManager. I am not sure if it will solve your problem but it may be worth checking it out. Check the MIDP 2.0 documentation for details.

It may also be easier to work with GameCanvas rather than Canvas, which
is a bit "funny" in terms of repaint behaviour. At least GameCanvas (in theory) ensures that when you call flushGraphics() the screen gets updated
synchronously.

PS: Ransinka, I am glad to see you're actively developing using J2ME ...
[ March 31, 2006: Message edited by: Eduardo Marques ]

Eduardo Marques
Get ready for your SCMAD certification at J2MECertificate.com - See what all the buzz is about ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Canvas re sizing and repainting
 
Similar Threads
save and load JPEG image from disk
Canvas and JPanel
Image Processing with HTML 5
Java Image
Garbage Collection & Memory Problem.