Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
compiled_is_better
Posts: 65
Registered: ‎12-16-2009
My Device: Not Specified

New developer - trying to get images working

I'm really just trying to understand whats going on rather than getting frusterated. I'm trying to understand why every time i add a new image to a folder, fresh my project so it shows up, but it still wont load into my Bitmap object unless i close eclipse and open it again, then run the app... what the heck! Is that normal?

 

Please use plain text.
New Developer
compiled_is_better
Posts: 65
Registered: ‎12-16-2009
My Device: Not Specified

Re: New developer - trying to get images working

actually closed the app didnt work, i thought it did, maybe it did once, but now no bueno!

 

"getBitmapResource" is the functoin im using. the files are indeed added to the project folder and wont load. Only the files i added about 2 hours ago work (same dir same file type, just new name)...

 

Please use plain text.
Developer
ibarrera
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: New developer - trying to get images working

Do you have them in a package or in an extra folder inside the project? In last case you should add this folder to the Java Build Path.

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.2174, Z10 (STL100-3)-10.3.0.700 Dev OS, Z30 (STA100-5)-10.3.0.700 Dev OS, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: New developer - trying to get images working

getBitmapResource searches from the root of the project, so if you add your image (test.bmp) to the folder test (with the namespace being this.is.a.test) then you need to do Bitmap.getBitmapResource("this.is.a.test.test.bmp"); If you put it outside the folder this (the root of the project) then you can do Bitmap.getBitmapResource("test.bmp");

 

You get it? Or is that not the problem you are having?

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.