如何在诺基亚C6中模拟相机midlet



我需要模拟诺基亚默认相机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); 

        }

尝试使用

 mCamera = Manager.createPlayer("capture://video");
 mCamera.realize();
 mCamera.prefetch();

或者您可以替换mCamera=Manager.createPlayer("capture://video");由

mCamera = Manager.createPlayer("capture://image");

最新更新