Graphics.RotateTransform Method (Single, MatrixOrder)
Applies the specified rotation to the transformation matrix of this Graphics in the specified order.
Assembly: System.Drawing (in System.Drawing.dll)
'Declaration Public Sub RotateTransform ( _ angle As Single, _ order As MatrixOrder _ )
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.
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.
Private Sub RotateTransformAngleMatrixOrder(ByVal e As PaintEventArgs) ' Set world transform of graphics object to translate. e.Graphics.TranslateTransform(100.0F, 0.0F) ' Then to rotate, appending rotation matrix. e.Graphics.RotateTransform(30.0F, MatrixOrder.Append) ' Draw translated, rotated ellipse to screen. e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), 0, 0, 200, 80) End Sub
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.