×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    44

    Draw/write on canvas

    In a touchscreen phone and using Java, is it possible to draw/write something on the screen and save it as an image?

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Draw/write on canvas

    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.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    44

    Re: Draw/write on canvas

    Is this using normal J2ME libraries, or are they Nokia-specific and need to be downloaded?

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Draw/write on canvas

    Quote Originally Posted by tuxette View Post
    Is this using normal J2ME libraries, or are they Nokia-specific and need to be downloaded?
    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 http://www.developer.nokia.com/Commu...ing_in_Java_ME for encoding help.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. Draw bidirectional string on canvas
    By dakoz in forum Mobile Java General
    Replies: 0
    Last Post: 2008-11-03, 14:48
  2. Can I draw icon on canvas?
    By JOM in forum Symbian
    Replies: 0
    Last Post: 2008-09-27, 20:10
  3. Draw Transparent png Image on Canvas
    By Stalkin in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2008-09-24, 19:19
  4. draw a line on a VideoCamera canvas
    By abhsax1978@hotmail.com in forum Streaming and Video
    Replies: 2
    Last Post: 2008-07-28, 10:22
  5. draw text box on canvas
    By Ashish_J2ME in forum Mobile Java General
    Replies: 1
    Last Post: 2006-11-22, 18:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×