I'm attempting to load a bitmap image from an images folder from within the res folder using - Bitmap.getBitmapResource("/images/bg_general.png")
But the image is not being开发者_如何学Go found even though it exists at specified path. Im using blackberry eclipse plugin. Here is a snippet of my dir structure where the image is located -
Bitmap.getBitmapResource("bg_general.png")
is the correct way to display the images. It works for me. Also, check whether the image is empty.
Try Bitmap.getBitmapResource("bg_general.png")
I think the file system is basically flattened in the cod file.
You might want to check "Bitmap.getBitmapResource - How to navigate through a folder hierarchy to refer to a PNG file."
Bitmap.getBitmapResource("images/bg_general.png");
remove the first /
, the getBitmapResource
function works with the res-folder as baseURL
.
It looks like it Searches for the file name automatically.... logically/makes sence to me it would be:
Bitmap logo = Bitmap.getBitmapResource("src/001.png");
or
Bitmap logo = Bitmap.getBitmapResource("res/001.png");
but just saying "001.png" is enough
Bitmap logo = Bitmap.getBitmapResource("001.png");
精彩评论