如何在我的黑莓模拟器上从源到图像获取图像

时间:2012-01-03 05:52:43

标签: blackberry

  

可能重复:
  Bundling images with Blackberry

您正在使用eclipse IDE为OS 5.0进行黑莓应用程序开发,但我无法找到从源代码获取PNG图像文件的代码,以便在我的黑莓模拟器上查看。

1 个答案:

答案 0 :(得分:3)

将图片粘贴到项目的 res 文件夹中。

enter image description here

然后使用Bitmap.getBitmapResource(..)获取图片。

Bitmap myImage = Bitmap.getBitmapResource("my_image.png");