Aracılığıyla paylaş


LinearGradientBrush.RotateTransform Yöntem

Tanım

Yerel geometrik dönüşümü belirtilen miktarda döndürür. Bu yöntem dönüşüme döndürmenin başına ekler.

Aşırı Yüklemeler

RotateTransform(Single)

Yerel geometrik dönüşümü belirtilen miktarda döndürür. Bu yöntem dönüşüme döndürmenin başına ekler.

RotateTransform(Single, MatrixOrder)

Yerel geometrik dönüşümü belirtilen sırada belirtilen miktarda döndürür.

RotateTransform(Single)

Kaynak:
LinearGradientBrush.cs
Kaynak:
LinearGradientBrush.cs
Kaynak:
LinearGradientBrush.cs

Yerel geometrik dönüşümü belirtilen miktarda döndürür. Bu yöntem dönüşüme döndürmenin başına ekler.

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

Parametreler

angle
Single

Dönüş açısı.

Örnekler

Örnek için bkz. RotateTransform

Şunlara uygulanır

RotateTransform(Single, MatrixOrder)

Kaynak:
LinearGradientBrush.cs
Kaynak:
LinearGradientBrush.cs
Kaynak:
LinearGradientBrush.cs

Yerel geometrik dönüşümü belirtilen sırada belirtilen miktarda döndürür.

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)

Parametreler

angle
Single

Dönüş açısı.

order
MatrixOrder

MatrixOrder Döndürme matrisinin eklenip eklenmeyeceğini veya eklenip eklenmeyeceğini belirten bir.

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve bir OnPaint olay nesnesi gerektirir.PaintEventArgse Kod

  • Yeni bir LinearGradientBrush oluşturur.

  • Bu fırçayı kullanarak ekrana üç nokta çizer.

  • LinearGradientBrush yöntemini çağırarak 45 dereceyi RotateTransform döndürür.

  • Döndürülmüş fırçayı kullanarak ilk üç noktanın hemen altındaki ekrana bir üç nokta çizer.

Alt elips gradyanının üst elipsin x eksenine 45 derecelik bir açıda olduğuna dikkat edin. Ayrıca, gradyan dolgunun TranslateTransform sol kenarını alt üç noktanın sol kenarıyla iki yana yaslama için yöntemine yapılan bir çağrının kullanıldığına da dikkat edin.

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

Şunlara uygulanır