我需要模拟诺基亚默认相机midlet的行为。
它是为诺基亚C6编写的,我正在用J2ME编写它。
我使用MMAPI,问题是VideoControl项的大小,我将其设为videoControl.setDisplayFulscreen(true);,但它根本不是全屏,setDisplaySize方法没有帮助,videoControl本身的大小大约是显示器的三分之一(所需的displaySize的其余部分是黑色的),以下是代码示例:
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);
}发布于 2013-03-06 15:58:45
试着使用
mCamera = Manager.createPlayer("capture://video");
mCamera.realize();
mCamera.prefetch();或者您可以将mCamera = Manager.createPlayer("capture://video");替换为
mCamera = Manager.createPlayer("capture://image");https://stackoverflow.com/questions/12167290
复制相似问题