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
New Developer
Posts: 40
Registered: ‎12-28-2011
My Device: Torch 9800

All about Bitmap Rotation

Hi, Does anyone knows how to rotate a Bitmap resource?

 

Let's say I need to create an analog clock app, with its hour, minute and second hands.

At somepoint the app will get current time, and draws the hand bitmaps at certain angle.

 

Some possible solutions I've found so far are

1. The ImageManipulator Class:

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

2. The graphics.drawTexturedPath ():

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/ui/Graphics.html

3. and manually draws 60 different bitmaps for each angle.

 

Could anyone suggest me which solution is best for my project requirement? and explain the pros and cons of the solution? Thank you for your time.

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

Re: All about Bitmap Rotation

If you want the image to look good, with shading and the like, then 60 images is the way to go.  Attempting to rotate an image will result in a less than perfect representation.  Using a small clock you might get away with this, but not if you are filling the screen.