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

或者可以替换Camera = Manager.create Player(“ capture:// video”);通过
mCamera = Manager.createPlayer("capture://image");

08-17 05:17