Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 08:30, 25 September 2007.

How to display the camera & take snapshots in Java ME

From Forum Nokia Wiki


The following code is used for camera display:

public void cameraPlayer() {
    try {
        player = Manager.createPlayer("capture://video");
        player.realize();
            
        videoControl = (VideoControl)player.getControl("VideoControl");
        player.start();
    } catch (Exception e) {} 
}


The following code is used for capturing images using camera in Java ME:

byte[] raw = videoControl .getSnapshot(null);
Image image = Image.createImage(raw, 0, raw.length);

TODO: list available modes, and when you need to use a different locator

helpful links:

http://developers.sun.com/techtopics/mobility/midp/articles/picture/ http://www.java-tips.org/java-me-tips/midp/capturing-video-on-j2me-devices.html

Related Discussions
Thread Thread Starter Forum Replies Last Post
image_sizes() don't give all sizes expected noreli Python 7 2007-11-30 17:09
N70: getSnapshot() always activates camera flash mobile07 Mobile Java Media (Graphics & Sounds) 6 2006-08-31 20:26
6680 hangs when downloading animated GIF images benlast General Browsing 2 2006-03-12 14:24
camera problem in N73 krgvs General Symbian C++ 0 2008-04-17 07:04
Black screen when playing Video on Nokia 6680 cbazza@poliplus.com Mobile Java Media (Graphics & Sounds) 3 2007-01-26 17:24
 
Powered by MediaWiki