如何添加位图图像作为BlackBerry自定义对话框的背景

时间:2012-05-12 13:52:33

标签: blackberry

我知道通过覆盖Paint和sublayout方法来创建自定义对话框。我想添加一个普通的位图图像作为我正在创建的自定义对话框的背景。有人知道任何解决方案吗?

1 个答案:

答案 0 :(得分:0)

希望这就是你要找的东西

backgroundBitmap = Bitmap.getBitmapResource("background.png");
//Override the paint method to draw the background image.
    public void paint(Graphics graphics) {
        //Draw the background image and then call paint.
        graphics.drawBitmap(0, 0, 240, 240, backgroundBitmap, 0, 0);
        super.paint(graphics);
    }            
相关问题