05-06-2011 02:00 PM
I want to create a custom file picker component. So, All OS version that didn't support File Picker can still choose picture from their device...
I've already created the custom file picker, but it's still takes too long time for reading a lot of images from device..
Is there any multithreading ways to read n make thumbnail for showing all of images from Blackberry?
Thanx for your help..
05-06-2011 02:06 PM
One thing I would definitely suggest - have two different threads for reading images from the file system (#1) and for creating the thumbnails (#2). #1 is I/O intensive while #2 is CPU-intensive - this makes them an ideal pair for this job. Make sure your I/O thread has higher priority.
05-06-2011 02:11 PM
Thanx for the idea...
Is there any source code for learning this methods?
two thread that you mention, is it start in the same time? or the I/O thread must be start first, after get the first image, then the seconde thread is starting for resize the bitmap?
05-06-2011 02:22 PM
Have you seen these:
05-06-2011 02:29 PM
thanx peter for the links..
i've already read these links...
For thumbnails work around, is it just suitable for PNG format?
Or it can be used for JPEG format also?
Can you explain to me how it works?
Many thanx for all...
05-06-2011 03:10 PM
It's only PNG, J2ME's native image format is PNG so that's what is used. Just in addition to Peter's post, I had a post about the "new" thumbnail format used in 5.0 and higher:
The function doesn't brute-force the seraching of images so it should be fast.
05-06-2011 09:46 PM
So, what i mean is, this generate thumbnail just for loading PNG file? or create a file with format PNG?
Still confused about the source code actually...
Can you give me hint for how to use it?
Really apreciated it...
Thanx for the answer, and pardon me if i don't understand
05-06-2011 10:06 PM
Well, it gets you the PNG image data.
For devices <=4.7:
For devices >= 5.0:
Now take the data from one of the 2 operations and create an EncodedImage with it. The rest is up to you.
05-07-2011 11:19 AM
At first I wasn't sure I understood your question but I think I get it now.
If you are reading the images themselves then just use an EncodedImage, it takes all supported image formats.
But BlackBerry has specific files that contain the thumbnails of images. The previously mentioned posts are mostly on how to use these. That way you don't need to scale the image and they are already at thumbnail size.