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
swayamism
Posts: 101
Registered: ‎10-08-2012
My Carrier: AirTel
Accepted Solution

Resizing Image to new dimensions

What would be the most efficient way to resize an image in BlackBerry ?

Suppose there is an image with dimensions of 700x700 and I wish to scale it down to 300x300 ?

 

I am scaling it down, so quality of the picture should not be a problem I guess.

Please use plain text.
Developer
shaan_softwaredvlpr
Posts: 172
Registered: ‎01-17-2011
My Carrier: Airtel

Re: Resizing Image to new dimensions

Hi to resize image , Follow this code.

 

Bitmap myBmp = new Bitmap ( 300  , 300);
<Your 700 bitmap image >.scaleInto(myBmp, Bitmap.FILTER_BILINEAR);

This code works fine , untill you dont have transparency in Bitmap image. if you will resize an transparent image , transparent part will be filled by white space.

Please use plain text.
Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Carrier: Airtel

Re: Resizing Image to new dimensions

Please use plain text.
Developer
swayamism
Posts: 101
Registered: ‎10-08-2012
My Carrier: AirTel

Re: Resizing Image to new dimensions

Thank you the answer. Helped me a lot.

Please use plain text.