Aracılığıyla paylaş


PathGradientBrush.RotateTransform Yöntem

Tanım

Belirtilen açının saat yönündeki döndürmesini yerel geometrik dönüşüme uygular.

Aşırı Yüklemeler

RotateTransform(Single)

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

RotateTransform(Single, MatrixOrder)

Yerel geometrik dönüşümü belirtilen sırada belirtilen miktara göre döndürür.

RotateTransform(Single)

Kaynak:
PathGradientBrush.cs
Kaynak:
PathGradientBrush.cs
Kaynak:
PathGradientBrush.cs

Yerel geometrik dönüşümü belirtilen miktarda döndürür. Bu yöntem dönüştürmeye 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öndürme açısı (kapsam).

Örnekler

Örnek için bkz. RotateTransform

Şunlara uygulanır

RotateTransform(Single, MatrixOrder)

Kaynak:
PathGradientBrush.cs
Kaynak:
PathGradientBrush.cs
Kaynak:
PathGradientBrush.cs

Yerel geometrik dönüşümü belirtilen sırada belirtilen miktara göre 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öndürme açısı (kapsam).

order
MatrixOrder

MatrixOrder Döndürme matrisinin eklenip eklenmeyeceğini veya ön 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 aşağıdaki eylemleri gerçekleştirir:

  • Bir grafik yolu oluşturur ve buna bir dikdörtgen ekler.

  • Yol noktalarından bir PathGradientBrush oluşturur (bu örnekte, noktalar bir dikdörtgen oluşturur, ancak çoğu şekilde olabilir).

  • Orta rengi kırmızıya, çevresindeki rengi maviye ayarlar.

  • Döndürme dönüşümünü PathGradientBrush uygulamadan önce öğesini ekrana çizer.

  • Döndürme dönüşümünü RotateTransform yöntemini kullanarak fırçaya uygular.

  • Döndürülmüş fırçayı (dikdörtgen) ekrana çizer.

Alt dikdörtgenin, çeviriden önce çizilen dikdörtgene kıyasla 45 derece döndürüldüğünü göreceksiniz.

public:
   void RotateTransformExample( PaintEventArgs^ e )
   {
      // Create a graphics path and add an ellipse.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      Rectangle rect = Rectangle(100,20,100,50);
      myPath->AddRectangle( rect );

      // Get the path's array of points.
      array<PointF>^myPathPointArray = myPath->PathPoints;

      // Create a path gradient brush.
      PathGradientBrush^ myPGBrush = gcnew PathGradientBrush( myPathPointArray );

      // Set the color span.
      myPGBrush->CenterColor = Color::Red;
      array<Color>^ mySurroundColor = {Color::Blue};
      myPGBrush->SurroundColors = mySurroundColor;

      // Draw the brush to the screen prior to transformation.
      e->Graphics->FillRectangle( myPGBrush, 10, 10, 200, 200 );

      // Apply the rotate transform to the brush.
      myPGBrush->RotateTransform( 45, MatrixOrder::Append );

      // Draw the brush to the screen again after applying the
      // transform.
      e->Graphics->FillRectangle( myPGBrush, 10, 10, 200, 300 );
   }
public void RotateTransformExample(PaintEventArgs e)
{
             
    // Create a graphics path and add an ellipse.
    GraphicsPath myPath = new GraphicsPath();
    Rectangle rect = new Rectangle(100, 20, 100, 50);
    myPath.AddRectangle(rect);
             
    // Get the path's array of points.
    PointF[] myPathPointArray = myPath.PathPoints;
             
    // Create a path gradient brush.
    PathGradientBrush myPGBrush = new
        PathGradientBrush(myPathPointArray);
             
    // Set the color span.
    myPGBrush.CenterColor = Color.Red;
    Color[] mySurroundColor = {Color.Blue};
    myPGBrush.SurroundColors = mySurroundColor;
             
    // Draw the brush to the screen prior to transformation.
    e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 200);
             
    // Apply the rotate transform to the brush.
    myPGBrush.RotateTransform(45, MatrixOrder.Append);
             
    // Draw the brush to the screen again after applying the
    // transform.
    e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 300);
}
Public Sub RotateTransformExample(ByVal e As PaintEventArgs)

    ' Create a graphics path and add a rectangle.
    Dim myPath As New GraphicsPath
    Dim rect As New Rectangle(100, 20, 100, 50)
    myPath.AddRectangle(rect)

    ' Get the path's array of points.
    Dim myPathPointArray As PointF() = myPath.PathPoints

    ' Create a path gradient brush.
    Dim myPGBrush As New PathGradientBrush(myPathPointArray)

    ' Set the color span.
    myPGBrush.CenterColor = Color.Red
    Dim mySurroundColor As Color() = {Color.Blue}
    myPGBrush.SurroundColors = mySurroundColor

    ' Draw the brush to the screen prior to transformation.
    e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 200)

    ' Apply the rotate transform to the brush.
    myPGBrush.RotateTransform(45, MatrixOrder.Append)

    ' Draw the brush to the screen again after applying the
    ' transform.
    e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 300)
End Sub

Şunlara uygulanır