开发者

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

开发者 https://www.devze.com 2023-02-24 06:33 出处:网络
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

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

精彩评论

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