In a touchscreen phone and using Java, is it possible to draw/write something on the screen and save it as an image?
Printable View
In a touchscreen phone and using Java, is it possible to draw/write something on the screen and save it as an image?
Yes, you can directly use touch events on the Canvas to draw the points on an empty image which you can draw in turn on the canvas and save that image if needed.
Is this using normal J2ME libraries, or are they Nokia-specific and need to be downloaded?
[QUOTE=tuxette;850215]Is this using normal J2ME libraries, or are they Nokia-specific and need to be downloaded?[/QUOTE]
Yes, this can be done using only MIDP J2me libraries only.
Create a Image object of the size same as Canvas.
Fetch the graphics instance gg from this Image Object, draw all pointer events on this Image object using gg.draw().
Now repaint this Image on the Canvas after every point event is drawn on the image, using the default paint method and g of the Canvas.
This way you will have all pointer events on the screen as well on your image - safe the image converting it to PNG or JEPG format and using File Connection API's.
You can refer to [url]http://www.developer.nokia.com/Community/Wiki/PNG_Encoding_in_Java_ME[/url] for encoding help.