RotateTransform

The RotateTransform rotates an object clockwise about a specified point in a two-dimensional x-y coordinate system. A RotateTransform is defined by the following properties: Angle rotates an object by a specified angle about the point CenterX, CenterY.

When you use a RotateTransform, the transformation rotates the coordinate system for a particular object about the origin point for its frame of reference. Therefore, depending on the position of the object, it might not rotate in place (around its center). For example, if an object is positioned 200 units from 0 along the x-axis, a rotation of 30 degrees can swing the object 30 degrees along a circle that has a radius of 200, which is drawn around the origin. To rotate an object in place, set the CenterX and CenterY of the RotateTransform to the center of the object to rotate.

Multiple transforms can be applied with a TransformGroup.

For example:

<c1:C1LayoutTransformer >

    <c1:C1LayoutTransformer.LayoutTransform>

        <RotateTransform Angle="90"></RotateTransform>

    </c1:C1LayoutTransformer.LayoutTransform>

    <Button Background="DarkMagenta" Content="Rotate" Height="80" Width="180" HorizontalAlignment="Right" VerticalAlignment="Top"/>

</c1:C1LayoutTransformer>


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.