0

我最近刚接触黑莓,我正在开发一个相机应用程序,在该方法中初始化相机我使用 videocontrol 对象来初始化相机,我使用的代码如下: 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);” 控制器无法占据如图所示的大小

所以有人可以在这方面帮助我吗

关于平克什·古普塔

4

1 回答 1

0

您必须在主屏幕构造函数中提供标志MainScreen.USE_ALL_WIDTH|MainScreen.USE_ALL_HEIGHT。看看黑莓对此有何评论

于 2011-11-24T07:29:21.820 回答