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
Contributor
Posts: 22
Registered: ‎06-02-2010
My Device: 8330
My Carrier: Rogers & Bell
Accepted Solution

panning / scrolling an image.

I searched the forums, tried example code but nothing will work. Now that's that's out the way...

 

I am developing an application targeting OS version 4.5.x that allows users to view scanned images that are in PNG format. The PNG files are 1728 * 1093 pixels at 204 x 98 DPI with a bit depth of 1 (monochrome/Black & white)

 

The files are approx 40-50K in size. I want to simply display the image on the screen larger then screen size and be able to pan the image around, horz and vertical scroll. Seems easy doesn't it...dont' get too excited yet...

 

ALL of the examples I see working with images seem to want you to extract a Bitmap from the source image. I tried the ScrollableImageField example class found elsewhere in the forums and it's too SLOW. The issue is that EncodedImage.getBitmap() is too SLOW. In fact it's pretty bad when I have to make a dialog to the user "Your image is now loading, you may holster your device and I will buzz you when it's ready to view!".. When I convert the 43K PNG to a Bitmap the bitmap object is approx 250K so I assume this is too large for a B.B?

 

 

I have also tried creating a BitmapField object and use BitmapField.setBitmap(EncodedImage). This seems the fastest way and avoids the EncodedImage.getbitmap() HOWEVER I cannot scroll a BitmapField.

 

urrgggggg I want to pull my hear out....or build this app for a newer OS/device, but I must make this work.

 

Any suggestions?

BlackBerry Development Advisor
Posts: 15,302
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: panning / scrolling an image.

Doe the images need to stay that large?  What about reducing their resolution first?

 

Rotate and scale bitmaps

http://supportforums.blackberry.com/t5/Java-Development/Rotate-and-scale-bitmaps/ta-p/492524

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 19,633
Registered: ‎07-14-2008
My Device: Not Specified

Re: panning / scrolling an image.

I don't understand this:

"HOWEVER I cannot scroll a BitmapField"

 

Isn't the ScrollableImageField just a BitmapField?