开发者

What is the easiest way to set background image of the application on Blackberry

I know, this questi开发者_Go百科on was asked before. However I can't beleive that this operation is so difficult. I think i miss some important points on developing Blackberry applications.


Try to use the following code:

Bitmap backgroundBitmap = Bitmap.getBitmapResource("background.png");

HorizontalFieldManager horizontalFieldManager = new
HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH |
HorizontalFieldManager.USE_ALL_HEIGHT){

//Override the paint method to draw the background image.
public void paint(Graphics graphics)
{

//Draw the background image and then call super.paint
//to paint the rest of the screen.
graphics.drawBitmap(0, 0, Display.getWidth(), Display.getHeight(),
backgroundBitmap, 0, 0);
super.paint(graphics);
}
};
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜