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
Contributor
Posts: 48
Registered: ‎04-07-2011
My Device: 9550
My Carrier: Desktop

How to rotate an image without loosing image quality

Hi Frinds,

 

   I have rotated an image but thai image loosing its quality.

   How to rotate an image in any direction without loosing image quality.

   Please help me 

  

 

 

Thanks & Regards ,

Nagarjuna Metla.

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

Re: How to rotate an image without loosing image quality

You can't. 

 

Or more accurately, when you rotate an image and then map it back into horizontal and vertical pixels, with the exception of certain angles (80, 180, 270) each pixel becomes an approximation based on the pixels that would be be rotated to overlap that point. 

 

You can see the same sort of effect with scaling, and there is a good explanation of how that introduces artifacts here:

http://en.wikipedia.org/wiki/Image_scaling

 

I can't find anything similar for rotation sorry.

 

Anyway, perhaps your rotation algorithm could be improved.  Are you using this?

http://supportforums.blackberry.com/t5/Java-Development/Rotate-and-scale-bitmaps/ta-p/492524

 

I suspect that there is other Java code that might help, but I have never looked.  So do an internet search and see if you can find a BlackBerry or J2ME Library that might be better.

 

Good luck.