LinearGradientBrush.RotateTransform Methode

Definition

Dreht die lokale geometrische Transformation um den angegebenen Betrag. Diese Methode stellt der Transformation die Rotation voran.

Überlädt

RotateTransform(Single)

Dreht die lokale geometrische Transformation um den angegebenen Betrag. Diese Methode stellt der Transformation die Rotation voran.

RotateTransform(Single, MatrixOrder)

Dreht die lokale geometrische Transformation um den angegebenen Betrag in der angegebenen Reihenfolge.

RotateTransform(Single)

Dreht die lokale geometrische Transformation um den angegebenen Betrag. Diese Methode stellt der Transformation die Rotation voran.

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

Parameter

angle
Single

Der Rotationswinkel.

Beispiele

Ein Beispiel finden Sie unter RotateTransform.

Gilt für

RotateTransform(Single, MatrixOrder)

Dreht die lokale geometrische Transformation um den angegebenen Betrag in der angegebenen Reihenfolge.

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)

Parameter

angle
Single

Der Rotationswinkel.

order
MatrixOrder

Eine MatrixOrder, die angibt, ob die Rotationsmatrix vorangestellt oder angefügt werden soll.

Beispiele

Das folgende Codebeispiel wurde für die Verwendung mit Windows Forms entwickelt und erfordert PaintEventArgs eein OnPaint Ereignisobjekt. Der Code

  • Erstellt einen neuen LinearGradientBrush.

  • Zeichnet mit diesem Pinsel eine Auslassungspunkte auf den Bildschirm.

  • Dreht die LinearGradientBrush 45 Grad durch Aufrufen der RotateTransform Methode.

  • Zeichnet eine Auslassungspunkte direkt unterhalb der ersten Auslassungspunkte auf dem Bildschirm, wobei der gedrehte Pinsel verwendet wird.

Beachten Sie, dass der Farbverlauf der unteren Auslassungspunkte in einem Winkel von 45 Grad auf die x-Achse der oberen Auslassungspunkte liegt. Beachten Sie auch, dass ein Aufruf der TranslateTransform Methode verwendet wird, um den linken Rand der Farbverlaufsfüllung mit dem linken Rand der unteren Auslassungspunkte zu rechtfertigen.

private:
   void RotateTransformExample( PaintEventArgs^ e )
   {
      // Create a LinearGradientBrush.
      Rectangle myRect = Rectangle(20,20,200,100);
      LinearGradientBrush^ myLGBrush = gcnew LinearGradientBrush( myRect,Color::Blue,Color::Red,0.0f,true );

      // Draw an ellipse to the screen using the LinearGradientBrush.
      e->Graphics->FillEllipse( myLGBrush, myRect );

      // Rotate the LinearGradientBrush.
      myLGBrush->RotateTransform( 45.0f, MatrixOrder::Prepend );

      // Rejustify the brush to start at the left edge of the ellipse.
      myLGBrush->TranslateTransform(  -100.0f, 0.0f );

      // Draw a second ellipse to the screen using
      // the transformed brush.
      e->Graphics->FillEllipse( myLGBrush, 20, 150, 200, 100 );
   }
 private void RotateTransformExample(PaintEventArgs e)
 {
              
     // Create a LinearGradientBrush.
     Rectangle myRect = new Rectangle(20, 20, 200, 100);
     LinearGradientBrush myLGBrush = new LinearGradientBrush(
         myRect, Color.Blue, Color.Red,  0.0f, true);
              
     // Draw an ellipse to the screen using the LinearGradientBrush.
     e.Graphics.FillEllipse(myLGBrush, myRect);
              
     // Rotate the LinearGradientBrush.
     myLGBrush.RotateTransform(45.0f, MatrixOrder.Prepend);

     // Rejustify the brush to start at the left edge of the ellipse.
     myLGBrush.TranslateTransform(-100.0f, 0.0f);
              
     // Draw a second ellipse to the screen using
     // the transformed brush.
     e.Graphics.FillEllipse(myLGBrush, 20, 150, 200, 100);
 }
Public Sub RotateTransformExample(ByVal e As PaintEventArgs)

    ' Create a LinearGradientBrush.
    Dim myRect As New Rectangle(20, 20, 200, 100)
    Dim myLGBrush As New LinearGradientBrush(myRect, Color.Blue, _
    Color.Red, 0.0F, True)

    ' Draw an ellipse to the screen using the LinearGradientBrush.
    e.Graphics.FillEllipse(myLGBrush, myRect)

    ' Rotate the LinearGradientBrush.
    myLGBrush.RotateTransform(45.0F, MatrixOrder.Prepend)

    ' Rejustify the brush to start at the left edge of the ellipse.
    myLGBrush.TranslateTransform(-100.0F, 0.0F)

    ' Draw a second ellipse to the screen using the transformed brush.
    e.Graphics.FillEllipse(myLGBrush, 20, 150, 200, 100)
End Sub

Gilt für