×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    4

    getSnapshot without displaying picture? (MMAPI - JSR 135)

    Is it possible to getSnapshot without displaying picture on any Canvas? I've tried many possible combinatons but allways ends up with black rectangle if i don't display image on Canvas (make video canvas current)?

    Here are some parts of application. First, camera is initialized

    player1 = Manager.createPlayer ("capture://video");
    player1.realize ();
    vc1 = (VideoControl)player1.getControl ("VideoControl");
    vc1.initDisplayMode (VideoControl.USE_DIRECT_VIDEO, videoCanvas);
    vc1.setDisplayFullScreen(false);
    vc1.setVisible(true);

    player1.start();



    after that I try to capture pictures in separate Thread.

    while(true) {
    disp.setCurrent(videoCanvas);
    capture();
    disp.setCurrent(appCanvas);
    appCanvas.repaint();
    }


    I would like to do that without

    disp.setCurrent(videoCanvas);


    in upper code. If I comment out this line then all I get is black rectangle..

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: getSnapshot without displaying picture? (MMAPI - JSR 135)

    Hello mkukec,

    first, you've defined with

    vc1.initDisplayMode (VideoControl.USE_DIRECT_VIDEO, videoCanvas);

    that you're using canvas in the first place. So leaving it out means not showing it on the display at all. More specific about this:

    "java.lang.Object initDisplayMode(int mode, java.lang.Object arg)
    ...
    When USE_DIRECT_VIDEO is specified for initDisplayMode, the arg argument must not be null and must be a javax.microedition.lcdui.Canvas or a subclass of it."

    Source: http://java.sun.com/javame/reference...eoControl.html

    Regards,
    r2j7
    Last edited by r2j7; 2007-11-27 at 17:44.

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    4

    Re: getSnapshot without displaying picture? (MMAPI - JSR 135)

    Thanks for answering. I've read you answer few times and then I've realized that I haven’t put question precise enough. I don't want to show picture from camera on any Form or Canvas. I don't want to show picture from camera on Display. I want to take picture (getSnapshot) without displaying what currently camera is showing, save picture in some Image and then maybe latter display it using Form or Canvas.

    I don't know if that would be possible because in API documentation for getSnapshot says "Get a snapshot of the displayed content."

    Is there any other way to get pixels/image from camera ther than using getSnapshot?

  4. #4
    Registered User
    Join Date
    Sep 2007
    Posts
    4

    Re: getSnapshot without displaying picture? (MMAPI - JSR 135)

    ROTFLMAO

    vc1.setDisplayLocation(-150,-150);

    hehe...Works beautifully on N70

Similar Threads

  1. FPC Bench, Database API and a lot more...
    By sblantipodi in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2008-03-23, 01:47
  2. Nokia 6275 MMAPI JSR 135 - Not working
    By badrinath.bahadur in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-10-10, 23:13
  3. JSR 135 error : MediaException
    By khalandar in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2007-02-13, 12:16
  4. JSR 135 / MMAPI Support List
    By remyschumm in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 2
    Last Post: 2006-02-07, 21:43
  5. List of supported Phones: Camera via JSR 135 / MMAPI ?
    By remyschumm in forum Mobile Java General
    Replies: 1
    Last Post: 2006-02-07, 16:28

Posting Permissions

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