TextureBrush.RotateTransform Метод

Определение

Поворачивает локальное геометрическое преобразование этого объекта TextureBrush на заданную величину. Этот метод добавляет поворот перед преобразованием.

Перегрузки

RotateTransform(Single)

Поворачивает локальное геометрическое преобразование этого объекта TextureBrush на заданную величину. Этот метод добавляет поворот перед преобразованием.

RotateTransform(Single, MatrixOrder)

Поворачивает локальное геометрического преобразование этого объекта TextureBrush с использованием заданных величин в заданном порядке.

RotateTransform(Single)

Поворачивает локальное геометрическое преобразование этого объекта TextureBrush на заданную величину. Этот метод добавляет поворот перед преобразованием.

public:
 void RotateTransform(float angle);
public void RotateTransform (float angle);
member this.RotateTransform : single -> unit
Public Sub RotateTransform (angle As Single)

Параметры

angle
Single

Угол поворота.

Примеры

В следующем примере используется Windows Forms и требуется PaintEventArgs eпараметр обработчика Paint событий. Код выполняет следующие действия.

  • Создает объект TextureBrush.

  • Поворот изображения текстуры на 90 градусов.

  • Заполняет прямоугольник.

void RotateTransform_Example1( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );

   // Rotate the texture image by 90 degrees.
   tBrush->RotateTransform( 90 );

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void RotateTransform_Example1(PaintEventArgs e)
{
             
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
             
    // Rotate the texture image by 90 degrees.
    tBrush.RotateTransform(90);
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub RotateTransform_Example1(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))

    ' Rotate the texture image by 90 degrees.
    tBrush.RotateTransform(90)

    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub

Применяется к

RotateTransform(Single, MatrixOrder)

Поворачивает локальное геометрического преобразование этого объекта TextureBrush с использованием заданных величин в заданном порядке.

public:
 void RotateTransform(float angle, System::Drawing::Drawing2D::MatrixOrder order);
public void RotateTransform (float angle, System.Drawing.Drawing2D.MatrixOrder order);
member this.RotateTransform : single * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub RotateTransform (angle As Single, order As MatrixOrder)

Параметры

angle
Single

Угол поворота.

order
MatrixOrder

Перечисление MatrixOrder, которое указывает, где добавляется матрица поворота: в начале или в конце.

Примеры

В следующем примере используется Windows Forms и требуется PaintEventArgs eпараметр обработчика Paint событий. Код выполняет следующие действия.

  • Создает объект TextureBrush.

  • Поворот изображения текстуры на 90 градусов.

  • Заполняет прямоугольник.

void RotateTransform_Example2( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew 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 );
}
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);
}
Public Sub RotateTransform_Example2(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As 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)
End Sub

Применяется к