What image format is fastest for BlackBerry?
Asked Answered
S

2

3

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?

Semibreve answered 25/3, 2010 at 17:11 Comment(0)
H
3

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.

Heisel answered 25/3, 2010 at 18:49 Comment(1)
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?Semibreve
C
1

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)

Cacodyl answered 25/3, 2010 at 17:28 Comment(3)
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 caseSemibreve
then try bmp but don't forget to turn off "convert image files to .png" option in BB project settingsCacodyl
EncodedImage has a getBitmap() function that you can use to convert any EncodedImage to a Bitmap.Dilisio

© 2022 - 2024 — McMap. All rights reserved.