How do I get bundled images with the BlackBerry Eclipse Plugin 1.1 Beta? I copied an image into “res/background.jpg” and tried to load it using Bitmap.getBitmapResource on background.jpg. Unfortunately, the image wasn’t found (Illegal argument exception). I tried moving my image file into the src folder as per the advice here, but that didn’t work either. I have opened up the .jar file and the background image is present at the root of the .jar file. The option to convert image files to .png isn’t selected either.
Links
Two things:
resfolder needs to be a “source directory” in Eclipse. You can achieve this by right-clicking on the folder and going to “Build Path” -> “Use As Source Folder”.Bitmap.getBitmapResource(), like Michael B. said above, you shouldn’t put the folder name in the path. Just callBitmap.getBitmapResource("background.jpg");Finally, I’m assuming that because your resource is called “background.jpg” you want it to be the background for a Screen. If this is the case, make sure to set the background using the Screen’s Main Manager instead of on the screen itself. For example: