我正在尝试为 Blackberry 9900 模拟器设置背景图像,我编写了如下代码
BitmapField _bitmap ;
private int phoneWidth = Display.getWidth();
private int cellHeight = Display.getHeight();
public MyScreen(){
super(Manager.USE_ALL_WIDTH | Manager.NO_VERTICAL_SCROLL);
final Bitmap background = Bitmap.getBitmapResource("black.jpg");
VerticalFieldManager vfm = new VerticalFieldManager(USE_ALL_HEIGHT | USE_ALL_WIDTH) {
public void paint(Graphics g) {
Bitmap scaled = new Bitmap(phoneWidth, cellHeight);
background.scaleInto(scaled, Bitmap.SCALE_TO_FIT);
g.drawBitmap(0, 0, phoneWidth, cellHeight,
background, 0, 0);
super.paint(g);
}
};
add(vfm);
}
我正在像这样在模拟器中获得输出
我希望背景图像填充完整的背景,任何帮助将不胜感激,提前谢谢你。