2012-08-28 30 views
3

我需要模擬諾基亞默認相機midlet的行爲。如何在諾基亞C6中模擬相機midlet?

這是諾基亞C6,我正在寫它在J2ME。

我使用MMAPI,問題是VideoControl項目的大小,我做了videoControl.setDisplayFulscreen(true);,但它根本不是全屏,setDisplaySize方法沒有幫助,videoControl本身的大小約爲顯示的三分之一(所需的顯示尺寸的剩下的只是黑色),這裏是一個代碼示例:

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); 


     } 
+0

您需要簽署您的應用程序。 – Lucifer

+0

我可以使用相機,但我希望我的相機看起來像諾基亞c6中的默認相機。他們有寬屏VideoControl無論是否在配置文件模式的景觀:( – TomasS

+0

用VerySign證書籤署你的應用程序。 – Lucifer

回答

0

嘗試使用

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

或者可以替換mCamera = Manager.createPlayer( 「捕獲://視頻」 );通過

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