Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Blackberry 如何创建包含VideoControl和图像的自定义字段?_Blackberry_Java Me_Camera_Blackberry Jde - Fatal编程技术网

Blackberry 如何创建包含VideoControl和图像的自定义字段?

Blackberry 如何创建包含VideoControl和图像的自定义字段?,blackberry,java-me,camera,blackberry-jde,Blackberry,Java Me,Camera,Blackberry Jde,这里是我的问题:我想创建一个特定的组件与相机和一个图像代表一个目标覆盖的视频控制的看法 首先,我想在主屏幕上显示一个标题栏的相机 这是我的密码: public class ScanScreen extends MainScreen { private ScanScreen() { super(); this.vfm = new VerticalFieldManager(Field.FIELD_VCENTER); this.contr

这里是我的问题:我想创建一个特定的组件与相机和一个图像代表一个目标覆盖的视频控制的看法

首先,我想在主屏幕上显示一个标题栏的相机

这是我的密码:

 public class ScanScreen extends MainScreen {
private ScanScreen() 
    {
        super();

        this.vfm = new VerticalFieldManager(Field.FIELD_VCENTER);

        this.controller = new ScanController(this);
        //Initialize the player.
        try
        {
            this.player = javax.microedition.media.Manager.createPlayer("capture://video?encoding=jpeg&width=1024&height=768");
            this.player.realize();
            this.player.prefetch();
            this.videoControl = (VideoControl) this.player.getControl("VideoControl");

            if(this.videoControl != null)
            {
                // Initialize the field where the content of the camera shall be displayed.
                Field videoField = (Field) this.videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");

                // Display the video control.
                this.videoControl.setDisplayFullScreen(true);
                this.videoControl.setVisible(true);

                // Start the player.
                this.player.start();

                // Add the video field to the main screen.
                if(videoField != null)
                {
                    this.vfm.add(videoField);
                }
                else
                {
                    LabelField sorry = new LabelField("Sorry, we cannot use camera right now.");
                    this.vfm.add(sorry);
                }
            }
        }
        catch(Exception e)
        {
            Dialog.alert(e.toString());
        }

        // TODO : the camera is hiding the title bar
        this.setTitle("Title");
        this.add(this.vfm);
    }
}
第一个问题是VideoControl的视图隐藏了我的标题栏。我怎样才能解决这个问题

第二件事:我有一个特定的矩形图像,表示一个透明的目标,我想在视频控件的视图上显示它

我首先尝试创建一个新的类扩展字段,返回该图像的维度,并使该图像显示在paint方法中(该类为“mypackage.CameraField”)。然后,我尝试在initDisplayMode中用我的新类“mypackage.CameraField”的名称实例化我的VideoField;但创建的视频字段为空

那么,有没有办法创造这种行为呢?我正在考虑“多媒体”文件夹中的本机应用程序“摄像机”,它在屏幕的特定区域显示视频控件


谢谢。

好的,似乎无法以任何方式自定义视频控件。我们必须全屏使用它,不能在上面显示任何内容