I’m using the Blackberry JDE Plugin v1.3 for Eclipse and I’m trying this code to create a BitmapField and I’ve always done it this way:
this.bitmap = EncodedImage.getEncodedImageResource("ico_01.png");
this.bitmap = this.bitmap.scaleImage32(
this.conf.getWidthScale(), this.conf.getHeightScale());
this.imagenLoad = new BitmapField(this.bitmap.getBitmap(), this.style);
It works fine with no errors, but now I have this set of images with the same name but in different subfolders like this:

I made it smaller than it actually is for explanatory reasons. I wouldn’t want to rename the files so they’re all different. I would like to know how to access the different subfolders. “res/img/on/ico_01.jpg”, “img/on/ico_01.jpg”, “on/ico_01.jpg” are some examples that I tried and failed.
It appears that
EncodedImage.getEncodedImageResource(filename)will retrieve the first instance offilenameregardless of where it is in your resource directory tree.This is not very helpful if you have the images with the same filename in different directories (as you have).
The solution I have used is to create my own method which can return an image based on a path and filename.