Blackberry 在我的黑莓应用程序中使用图片作为背景

Blackberry 在我的黑莓应用程序中使用图片作为背景,blackberry,java-me,Blackberry,Java Me,我正在尝试使用图片作为我的黑莓应用程序的背景,而不是默认的白色背景。我该怎么做 Background,BackgroundFactory可用于设置任何VerticalFieldManager、HorizontalFieldManager或Main屏幕的背景。此支持从JDE版本4.6.0开始提供 final Bitmap header_Bitmap = //your image VerticalFieldManager vfm_ = new VerticalFieldManager(

我正在尝试使用图片作为我的黑莓应用程序的背景,而不是默认的白色背景。我该怎么做

Background,BackgroundFactory可用于设置任何VerticalFieldManager、HorizontalFieldManager或Main屏幕的背景。此支持从JDE版本4.6.0开始提供

final Bitmap header_Bitmap = //your image
    VerticalFieldManager vfm_ = new VerticalFieldManager(
            Manager.NO_HORIZONTAL_SCROLL | Manager.NO_HORIZONTAL_SCROLLBAR
                    | Manager.NO_VERTICAL_SCROLL
                    | Manager.NO_VERTICAL_SCROLLBAR | Field.USE_ALL_WIDTH) {
        public void paint(Graphics graphics) {
            graphics.setBackgroundColor(0x040811);
            graphics.clear();
            graphics.drawBitmap(0, 0, header_Bitmap.getWidth(),
                    header_Bitmap.getHeight(), header_Bitmap, 0, 0);
            super.paint(graphics);
        }
    };
add(vfm_);
检查一下

Bitmap Bitmap=Bitmap.getBitmapResource(“myBitmap.png”);
Background=BackgroundFactory.createBitmapBackground(位图);
挫折背景(背景);