Reputation: 121
I need to simulate the behaviour of the default camera midlet from Nokia.
It's for Nokia C6, and I am writing it in J2ME.
I use MMAPI, the problem is the size of VideoControl item, I made it videoControl.setDisplayFulscreen(true);
but it ain't fullscreen at all, the method setDisplaySize doesn't help, the size of videoControl itself is roughly one third of the display (the rest of desired displaySize is just black), here's a code sample:
public CameraCanvas (Evidence_elektromeru midlet, ManagePhotos caller,String name) {
super(true);
this.midlet = midlet;
this.caller = caller;
this.name = name;
this.setFullScreenMode(true);
try {
player = Manager.createPlayer("capture://devcam0");
player.realize();
// player.prefetch();
if (videoControl2 != null)
videoControl2.setVisible(false);
videoControl1 = (VideoControl) player.getControl("VideoControl");
videoControl1.initDisplayMode(VideoControl.USE_DIRECT_VIDEO,this);
videoControl1.setDisplayLocation(0, 0);
videoControl1.setDisplaySize(360,500);
}catch (MediaException me2) {
try {
videoControl1.setDisplayFullScreen(true);
} catch (Exception e) {}
}
catch (Exception e) {}
finally {
try {
player.start();
} catch (Exception e) {}
videoControl1.setVisible(true);
}
Upvotes: 3
Views: 272
Reputation: 773
try to use
mCamera = Manager.createPlayer("capture://video");
mCamera.realize();
mCamera.prefetch();
or you can replace mCamera = Manager.createPlayer("capture://video"); by
mCamera = Manager.createPlayer("capture://image");
Upvotes: 0