我是黑莓新手 最近我正在研究相机应用程序 其中在方法初始化相机 我正在使用视频控制对象初始化相机 我使用的代码如下: private void initializeCamera() {
try
{
// Create a player for the Blackberry's camera
Player player = Manager.createPlayer( "capture://video" );
// Set the player to the REALIZED state (see Player javadoc)
player.realize();
_videoControl = (VideoControl)player.getControl( "VideoControl" );
if (_videoControl != null)
{
_videoField = (Field) _videoControl.initDisplayMode (VideoControl.USE_GUI_PRIMITIVE,"net.rim.device.api.ui.Field");
_videoControl.setDisplaySize(460,320 );
_videoControl.setVisible(true);
}
player.start();
}
catch(Exception e)
{
Camera.errorDialog("ERROR " + e.getClass() + ": " + e.getMessage());
}
}
在实现这样的代码时,我得到了默认视频控件大小的图像 但是我希望控制器应该占据控制器的大小 垂直现场经理
即使使用代码: “_videoControl.setDisplaySize(460,320);” 控制器无法占据显示的尺寸
在这方面,任何人都可以帮助我
问候 Pinkesh Gupta
答案 0 :(得分:0)
您必须在主屏幕构造函数中提供标记MainScreen.USE_ALL_WIDTH|MainScreen.USE_ALL_HEIGHT
。
查看what blackberry says about this