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
Developer
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

Creating EncodedImage from Bitmap object

Hello guys'

Do you know How to create Encoded Image object fromBitmap object ?

I need to zoom I/Out existing bitmap. For do this, I am using EncodedImage. 

Is there any solution ?

 

Tnx for ur advice'

Developer
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Creating EncodedImage from Bitmap object

How are you initially getting your Bitmap object?  Can you possibly read it as an EncodedImage or are you stuck with a Bitmap (as a result of taking a screenshot, for example)?  If it's the latter, then search the forum for PNGEncoder.  There are instructions on how to convert a Bitmap into an EncodedImage.
Developer
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: Creating EncodedImage from Bitmap object

I initialize bitmap object by byte array of JPG image.

 

EncodedImage image = EncodedImage.createEncodedImage(byteImage, 0, byteImage.length);

....

Bitmap bimap = image.getBitmap();

 

Now I need to get EncodedImage object from "bitmap".

Developer
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: Creating EncodedImage from Bitmap object

Has somebody any solutions ?
BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Creating EncodedImage from Bitmap object

Please have a look at this thread:  http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=763&query.id=6195...
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: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: Creating EncodedImage from Bitmap object

 Tnx a lot Mark Sohm' i got it;
Highlighted
Developer
Posts: 91
Registered: ‎06-21-2011
My Device: Blackberry Torch 9800
My Carrier: developer

Re: Creating EncodedImage from Bitmap object

I know one thing :Bitmap and EncodedImage have the same methods to acceess image:

for Bitmap - Bitmap..getBitmapResource(String imageName);

for EncodedImage - EncodedImage.getEncodedImageResource(String imageName);

Regards,
Arsen