The coordinates are the rotation's center point (called the pivot point in the docs).

See here for an interactive demo:

http://www.nbilyk.com/pivot-rotate-example

If you set these coordinates to the center of the canvas, you'll get the most intuitive result. But other rotations are possible as shown in the link above.

-- Kostya

18.09.2010 13:37, jlopeznava...@gmail.com пишет:
Can anybody explain me what is exactly that coordinates? I have search
for information but can't find properly info.
I have some drawables objects wich I need to rotate, I have realized I
need to add a constant value to that coordinates, if not they rotate
wrong.

I use this way:

==========================================================================================
canvas.save();
canvas.rotate(90 * mRotatationType, CTE_ROTATING_X_POINT + coordX,
CTE_ROTATING_Y_POINT + coordY);
canvas.restore;
==========================================================================================

Where:
-mRotatationType: is set to 0, 1, 2, or 3 in order to get a 0, 90,
180, 270º rotation.
-coordX and coordY are the top/left points of my drawable object.
-CTE_ROTATING_X_POINT and CTE_ROTATING_Y_POINT are set to "48" (if not
the drawables move in a different place after rotate). This is the
mistery for me.



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to