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
peter_strange
Posts: 19,604
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.

Please use plain text.
Regular Contributor
jayakrishnan_salim
Posts: 61
Registered: ‎05-22-2011
My Device: Blackberry Torch

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?)

Please use plain text.
Developer
peter_strange
Posts: 19,604
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. 

Please use plain text.
Regular Contributor
jayakrishnan_salim
Posts: 61
Registered: ‎05-22-2011
My Device: Blackberry Torch

Re: Reducing size of the image

Thanks a lot Peter.
Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Reducing size of the image

Let us know how you get on.

Please use plain text.