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
arsenk01
Posts: 91
Registered: ‎06-21-2011
My Device: Blackberry Torch 9800
My Carrier: developer

Image encoder getData return not scaled data

Hi All,

I have image which I read from stream and use EncodedImage to scale image.

Thats OK,but I want to get byte[] array of scaled image.When I use getData() function of EncodedImage it returns not scaled data,because when I try draw it draw big image not scaled one.

I need all this because I'm sending image to server and that server accepts only jpeg,png,gif image types.Thats why when I scale image and get scaled bitmap it's OK,and even OK to convert that bitmap back to byte array,and OK when I send that byte array to server,but but but server doesn't accept it.Alternative when I just send the not converted to bitmap and after back to  array all seems to work.

Can anybody help how to get resized image from byte array,because scale method as I understand works only with Bitmap.

 

p.s sorry for bad english

Regards,
Arsen
Please use plain text.
Developer
simon_hain
Posts: 15,863
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Image encoder getData return not scaled data

http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/system/EncodedImage.html#scale... int)

it returns a new EncodedImage object which is resized.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
arsenk01
Posts: 91
Registered: ‎06-21-2011
My Device: Blackberry Torch 9800
My Carrier: developer

Re: Image encoder getData return not scaled data

sorry but if it was resised I wouldn't asked that question however I foun solution.If anyone interests it is here

http://supportforums.blackberry.com/t5/Java-Development/how-to-convert-the-Bitmap-object-To-byteArra...

 

kishor273 reply which marked as answer is working.Thanks kishor.

 

Regards,
Arsen
Please use plain text.