×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question Can I capture signature as image in J2me?

    Is it possible to capture singnature as image in j2me. And what mobiles are supported for doing the same. Also provide me the specific link related API.

    Please Reply

    Rajan

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Can I capture signature as image in J2me?

    you can use the Canvas class and override the
    protected void pointerDragged(int x, int y)
    Called when the pointer is dragged.
    protected void pointerPressed(int x, int y)
    Called when the pointer is pressed.
    protected void pointerReleased(int x, int y)
    Called when the pointer is released.
    methods.
    start with pointerPressed, use the pointerDragged to draw the image with successive segments, and save it with pointerReleased.

  3. #3
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: Can I capture signature as image in J2me?

    Thankx for the reply...
    Also plz tell me , what mobiles are supported to take signature as image. I'm using Nokia 6220 Classic phone right now is it possible to do so with the same Mobile...

    Please Reply

  4. #4
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Can I capture signature as image in J2me?

    what i meant was for on screen signing with touch capture (so off course it won't work on 6220 classic)
    if you mean take a picture of a signature, then the fact that it is a signature is not relevant.
    check the wiki for examples of image capturing
    (for instance http://wiki.forum.nokia.com/index.ph...age_in_Java_ME )

  5. #5
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: Can I capture signature as image in J2me?

    Thanks in advance..

    No this is not my question.. I want to take signature from user using Stylus.

    Could u please tell which Mobiles are supported for the Signature application. Please provide me the list..

    Please Reply..

  6. #6
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Can I capture signature as image in J2me?

    are you refering to a particular stylus and/or signature application ?

  7. #7
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: Can I capture signature as image in J2me?

    Quote Originally Posted by njzk2 View Post
    are you refering to a particular stylus and/or signature application ?
    Actually i have to create this application in j2me and use it in winows mobile 6.1 which has Stylus, and through which i can take the signature .. from the user

    And what if i want to use signature not stylus

    Please Reply.
    Last edited by rajan701v; 2011-01-21 at 12:16.

  8. #8
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Can I capture signature as image in J2me?

    so it uses the touch screen of the phone, right ?

  9. #9
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: Can I capture signature as image in J2me?

    Quote Originally Posted by njzk2 View Post
    so it uses the touch screen of the phone, right ?
    Yes, it will use touch screen of the phone...

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Can I capture signature as image in J2me?

    Then, as njzk2 said earlier, you need a phone with a touch screen.

    Note that there are two kinds of touch screen.

    • Resistive screens support only single touch (they cannot detect if you touch two parts of the screen at the same time). Resistive screens work well with a stylus.
    • Capacitive screens support multi-touch, and work only when you touch them with your finger. You can use a stylus, but you need a special stylus designed for capacitive screens. Generally, devices with capactive screens do not ship with a stylus. In my experience, using the special styluses is not a good experience.


    Graham.

  11. #11
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: Can I capture signature as image in J2me?

    Can u please give me an example code regarding the same..
    Regards
    Rajan Verma

  12. #12
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: Can I capture signature as image in J2me?

    Quote Originally Posted by grahamhughes View Post
    Then, as njzk2 said earlier, you need a phone with a touch screen.

    Note that there are two kinds of touch screen.

    • Resistive screens support only single touch (they cannot detect if you touch two parts of the screen at the same time). Resistive screens work well with a stylus.
    • Capacitive screens support multi-touch, and work only when you touch them with your finger. You can use a stylus, but you need a special stylus designed for capacitive screens. Generally, devices with capactive screens do not ship with a stylus. In my experience, using the special styluses is not a good experience.


    Graham.
    thankx for giving reply.
    I have used pointerPressed and pointerdragged events for using signature. but i want to write a letter like A using stylus. Currently the stylus is working on my device but when i put a stylus and move around the screen it creates a circle on the screen. not any alphabetic letter.

    Please help me on this problem.

    Rajan
    Regards
    Rajan Verma

  13. #13
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question Re: Can I capture signature as image in J2me?

    What' the problem with this code ???
    PHP Code:

    package hello
    ;

    import javax.microedition.lcdui.*;

    /**
     * @author J2ME
     */
    public class MyCanvas extends Canvas implements CommandListener {

        
    /**
         * constructor
         */
        
    int startx 0;
        
    int starty 0;
        
    int currentx 0;
        
    int currenty 0;
        
    Signature midlet;
        private 
    int w;
        private 
    int h;

        public 
    MyCanvas() {
            try {
                
    // Set up this canvas to listen to command events
                
    setCommandListener(this);
                
    // Add the Exit command
                
    addCommand(new Command("Exit"Command.EXIT, 1));
            } catch (
    Exception e) {
                
    e.printStackTrace();
            }
        }

        public 
    MyCanvas(Signature mid){
            
    this.midlet mid;
            try {
                
    // Set up this canvas to listen to command events
                
    setCommandListener(this);
                
    // Add the Exit command
                
    addCommand(new Command("Exit"Command.EXIT, 1));
            } catch (
    Exception e) {
                
    e.printStackTrace();
            }
        }

        
    /**
         * paint
         */
        
    public void paint(Graphics g) {
            
    g.drawString("Sample Text"00Graphics.TOP Graphics.LEFT);
            
    g.setColor(012550);
            
    // Draw line
            
    g.drawLine(0,0,currentx,currenty);
        }

        
    /**
         * Called when a key is pressed.
         */
        
    protected void keyPressed(int keyCode) {
        }

        
    /**
         * Called when a key is released.
         */
        
    protected void keyReleased(int keyCode) {
        }

        
    /**
         * Called when a key is repeated (held down).
         */
        
    protected void keyRepeated(int keyCode) {
        }

        
    /**
         * Called when the pointer is dragged.
         */
        
    protected void pointerDragged(int xint y) {
            
    currentx x;
            
    currenty y;
            
    repaint(currentx,currenty,2*currentx,2*currenty);
        }

        
    /**
         * Called when the pointer is pressed.
         */
        
    protected void pointerPressed(int xint y) {
            
    startx x;
            
    starty y;
        }

        
    /**
         * Called when the pointer is released.
         */
        
    protected void pointerReleased(int xint y) {
            
    startx=x;
            
    starty=y;
        }

        
    /**
         * Called when action should be handled
         */
        
    public void commandAction(Command commandDisplayable displayable) {
            if(
    command.getCommandType() == Command.EXIT){
                
    midlet.exit();
            }
        }

        public 
    void getStylus(){
            
    getWidth();
            
    getHeight();
        }

    I want to write some charectors, through stylus. It is working but not creating a line but creating the dots. Like for writing alphabetical letter 'L' it creates like this:

    .
    .
    .
    .
    .
    ................

    Please Reply.

    Rajan
    Last edited by rajan701v; 2011-01-29 at 11:06.
    Regards
    Rajan Verma

  14. #14
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Can I capture signature as image in J2me?

    First thing:

    Quote Originally Posted by rajan701v View Post
    PHP Code:
            g.drawLine(0,0,currentx,currenty); 
    This always draws a line from (0, 0) - the top-left corner of the screen. You need to draw a point from the last (x,y) to the new (x.y).

    Quote Originally Posted by rajan701v View Post
    PHP Code:
            repaint(currentx,currenty,2*currentx,2*currenty); 
    I recommend you avoid this. Always repaint(), with no x, y, w, h, to repaint the whole screen. The paint() method should always repaint the entire screen, not just update it.

    Graham.

  15. #15
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: Can I capture signature as image in J2me?

    thanks for the reply grahamhughes.

    But i need the signature as you can see from this link :
    http://www.erstenware.com/animated_signature/index.html

    I want to create this in j2me
    I followed your steps but i could'nt find much help.

    Please Reply.
    Regards
    Rajan Verma

Similar Threads

  1. can J2ME access camera(image capture) event from N73 device
    By rajivmodh in forum Mobile Java General
    Replies: 4
    Last Post: 2009-12-15, 05:51
  2. [moved] Capture image using capture://image or capture://video
    By bilal.lodhi in forum Mobile Java General
    Replies: 2
    Last Post: 2009-07-11, 12:20
  3. Image as a menu bar in Canvas in j2me
    By soumengoswami in forum Mobile Java General
    Replies: 2
    Last Post: 2009-05-15, 07:25
  4. how can i capture image with a background image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-01-23, 16:35
  5. Replies: 4
    Last Post: 2006-12-14, 12:33

Posting Permissions

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