Image rotation

magarcan

Active Member
Licensed User
Longtime User
I want to do something like this. When you press over the line, and pressing you move your finger arround the circle, the image rotates to the position where you stop pressing.

Some pictures:

This is the initial estate:
ss48000.jpg


Then you press over the line and moves to rigth (red line is the finger movement):
ss48000copia.jpg

The red point in center is only for reference.

At the end, you stop pressing in the following position, so image comes up like this:
ss48000copia2.jpg


-Any idea about how can I implement this?

-An other question. When I define an ImageView it is square, can I change the shape in order to be round?

Thanks!!
 

magarcan

Active Member
Licensed User
Longtime User
You can draw rotated bitmaps with Canvas.DrawBitmapRotated. You will need to handle the panel or activity Touch event, calculate the correct angle and then draw the rotated bitmap.

Views are always shaped as rectangles.
I load my image in a Imageview. I've seen that DrawBitmapRotated it's only for canvas. How can I load my image with canvas? I've seen some samples but are too complex.

Thanks!
 
Upvote 0
Top