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: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Reducing size of the image

"Are you saying that this method will return a compressed PNG image byte array?"

Yes.

Developer
Posts: 80
Registered: ‎05-22-2011
My Device: Blackberry Torch
My Carrier: Airtel

Re: Reducing size of the image

[ Edited ]

And also the size will be small? (Can I convert a 32KB PNG image to 5KB with the help of scaleImage32() method?)

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Reducing size of the image

[ Edited ]

You can't predetermine the file size.  That depends on how well the processing can compress the file.

 

You have an image that is 50 x 50, that is 2500 pixels.  Each pixel requires (I think) 4 bytes, so an uncompressed 50 x 50 image should take 10 Kb.  Compressed should be smaller. 

 

Try this with your standard desktop image manipulation software - even standard Microsoft paint will do this. 

Highlighted
Developer
Posts: 80
Registered: ‎05-22-2011
My Device: Blackberry Torch
My Carrier: Airtel

Re: Reducing size of the image

Thanks a lot Peter.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Reducing size of the image

Let us know how you get on.