Graphics.RotateTransform Method (Single, MatrixOrder)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Applies the specified rotation to the transformation matrix of this Graphics in the specified order.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

member RotateTransform : 
        angle:float32 *
        order:MatrixOrder -> unit

Parameters

angle
Type: System.Single

Angle of rotation in degrees.

order
Type: System.Drawing.Drawing2D.MatrixOrder

Member of the MatrixOrder enumeration that specifies whether the rotation is appended or prepended to the matrix transformation.

The rotation operation consists of multiplying the transformation matrix by a matrix whose elements are derived from the angle parameter. This method prepends or appends the transformation matrix of the Graphics by the rotation matrix according to the order parameter.

The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. The code performs the following actions:

  • Translates the world transformation matrix of the Windows Form by the vector (100, 0).

  • Rotates the world transform by an angle of 30 degrees, appending the rotation matrix to the world transformation matrix with Append.

  • Draws a translated, rotated ellipse with a blue pen.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: