本文介绍了你怎么设置背景图片中使用Java的BlackBerry应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是如何在Java BlackBerry模拟器设置背景图片?
BackgroundBitmap指令= Bitmap.getBitma $ P $的PSource(background.png);
MainScreen mainScreen =新MainScreen();HorizontalFieldManager horizontalFieldManager =
新HorizontalFieldManager(
HorizontalFieldManager.USE_ALL_WIDTH |
HorizontalFieldManager.USE_ALL_HEIGHT){ //覆盖paint方法来绘制背景图片。
公共无效漆(图形图像){
//绘制背景图片,然后调用paint。
graphics.drawBitmap(0,0,240,240,BackgroundBitmap指令,0,0);
super.paint(图形);
} };
解决方案
试试这个博客帖子:结果
还是这个支持论坛主题:结果
图中Mainscreen背景位图
how i set background image in java blackberry simulator ?
backgroundBitmap = Bitmap.getBitmapResource("background.png");
MainScreen mainScreen = new MainScreen();
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 paint.
graphics.drawBitmap(0, 0, 240, 240, backgroundBitmap, 0, 0);
super.paint(graphics);
}
};
解决方案
try this blog post:
How to set Background Image in Blackberry
Or this support forum thread:
drawing bitmap in Mainscreen background
这篇关于你怎么设置背景图片中使用Java的BlackBerry应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!