TextureBrush.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.

Rotates the local geometric transformation of this TextureBrush object by the specified amount in the specified order.

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

public void RotateTransform(
	float angle,
	MatrixOrder order
)

Parameters

angle
Type: System.Single

The angle of rotation.

order
Type: System.Drawing.Drawing2D.MatrixOrder

A MatrixOrder enumeration that specifies whether to append or prepend the rotation matrix.

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

  • Creates a TextureBrush object.

  • Rotates the texture image by 90 degrees.

  • Fills a rectangle.

public void RotateTransform_Example2(PaintEventArgs e)
{

    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));

    // Rotate the texture image by 90 degrees.
    tBrush.RotateTransform(90, MatrixOrder.Prepend);

    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}

.NET Framework
Available since 1.1
Return to top
Show: