标签: blackberry
可能重复: Bundling images with Blackberry
您正在使用eclipse IDE为OS 5.0进行黑莓应用程序开发,但我无法找到从源代码获取PNG图像文件的代码,以便在我的黑莓模拟器上查看。
答案 0 :(得分:3)
将图片粘贴到项目的 res 文件夹中。
res
。
然后使用Bitmap.getBitmapResource(..)获取图片。
Bitmap.getBitmapResource(..)
Bitmap myImage = Bitmap.getBitmapResource("my_image.png");