你怎么设置背景图片中使用Java的BlackBerry应用程序? [英] How do you set the background image in a BlackBerry application using Java?

查看:319
本文介绍了你怎么设置背景图片中使用Java的BlackBerry应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是如何在Java BlackBerry模拟器设置背景图片?

  BackgroundBitmap指令= Bitmap.getBitma $ P $的PSource(background.png);
MainScreen mainScreen =新MainScreen();Horizo​​ntalFieldManager horizo​​ntalFieldManager =
    新Horizo​​ntalFieldManager(
        Horizo​​ntalFieldManager.USE_ALL_WIDTH |
        Horizo​​ntalFieldManager.USE_ALL_HEIGHT){        //覆盖paint方法来绘制背景图片。
        公共无效漆(图形图像){
            //绘制背景图片,然后调用paint。
            graphics.drawBitmap(0,0,240,240,BackgroundBitmap指令,0,0);
            super.paint(图形);
        }    };


解决方案

试试这个博客帖子:结果
如何设置背景图片在黑莓

还是这个支持论坛主题:结果
<一href=\"http://supportforums.blackberry.com/t5/Java-Development/drawing-bitmap-in-Mainscreen-background/m-p/211199\"相对=nofollow>图中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应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆