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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
Raiden
Posts: 490
Registered: ‎07-16-2008
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'

Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008

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.
Please use plain text.
Developer
Raiden
Posts: 490
Registered: ‎07-16-2008

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".

Please use plain text.
Developer
Raiden
Posts: 490
Registered: ‎07-16-2008

Re: Creating EncodedImage from Bitmap object

Has somebody any solutions ?
Please use plain text.
Administrator
MSohm
Posts: 12,957
Registered: ‎07-09-2008
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.
Found a bug? Report it using the Issue Tracker
Please use plain text.
Developer
Raiden
Posts: 490
Registered: ‎07-16-2008

Re: Creating EncodedImage from Bitmap object

 Tnx a lot Mark Sohm' i got it;
Please use plain text.
Developer
arsenk01
Posts: 91
Registered: ‎06-21-2011
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
Please use plain text.