【问题标题】:Blackberry App - Bitmap Picture not showing黑莓应用程序 - 位图图片不显示
【发布时间】:2013-09-06 10:09:54
【问题描述】:

我感觉它与图像路径有关,它没有检测到图像。我是黑莓开发新手。

应用程序运行但图像不显示。可能图片位置不对?

public final class Welcome extends MainScreen
{
    /**
     * Creates a new Welcome object
     */
    public Welcome()
    {        
        // Set the displayed title of the screen       
        setTitle("Select a brand");

        Bitmap bitmapImage = Bitmap.getBitmapResource("/BrowserBlackberry/res/img/Celsian.jpg");
        BitmapField fieldDemo = new BitmapField(bitmapImage);    
        fieldDemo.setBorder(150,getBorder(20));
        fieldDemo.getBackground(Background.POSITION_X_CENTER);

        add(fieldDemo);
    }
}

【问题讨论】:

  • 如果您的图片在 res 文件夹中,则将图片添加为 -Bitmap bitmapImage = Bitmap.getBitmapResource("Celsian.jpg");

标签: java blackberry bitmap blackberry-eclipse-plugin blackberry-jde


【解决方案1】:

试试这个

 public Welcome()
{        
    // Set the displayed title of the screen       
    setTitle("Select a brand");

    Bitmap bitmapImage = Bitmap.getBitmapResource("Celsian.jpg");
    BitmapField fieldDemo = new BitmapField(bitmapImage);    
    add(fieldDemo);

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多