views:

202

answers:

2

I'm trying to load some images using Bitmap.getBitmapResource(), but it takes about 2 or 3 seconds per image to load. I'm testing on the Storm, specifically. The odd thing is, when I install OS 5.0, the loading goes in a snap, no delay at all.

Should I be looking at the format used? Or where the files are stored? I've tried both 24- and 8-bit PNGs, with transparency. The files are stored in a subdirectory in the COD, so getBitmapResource is passed a path, like "images/img1.png" instead of just "img1.png".

Is any of this making things slower?

A: 

Try to use EncodedImage, see Is it better to use Bitmap or EncodedImage in BlackBerry?
In case you need Bitmap class, try also bmp (don't forget to turn off "convert image files to .png" option in BB project settings)

Max Gontar
Hmm... the only problem with that is that the image needs to be repainted often, and the answer there says to use Bitmaps in that case
Ed Marty
then try bmp but don't forget to turn off "convert image files to .png" option in BB project settings
Max Gontar
EncodedImage has a getBitmap() function that you can use to convert any EncodedImage to a Bitmap.
Fostah
+3  A: 

If you're looking for the most efficient format for storing image data within your application binary, the recommendation is PNG with the 565 colorspace. The BlackBerry Theme Studio toolkit has the ability to load any PNG and export it in this format. Its the best one because its what the BlackBerry uses internally.

octo
any thoughts on how to do this with photoshop? I could probably figure it out, but would you happen to know off the top of your head?
Ed Marty