PathGradientBrush.RotateTransform 메서드

정의

지정된 각도의 시계 방향 회전을 로컬 기하학적 변환에 적용합니다.

오버로드

Name Description
RotateTransform(Single)

지정된 양만큼 로컬 기하학적 변환을 회전합니다. 이 메서드는 변환 앞에 회전을 추가합니다.

RotateTransform(Single, MatrixOrder)

지정된 순서로 지정된 양만큼 로컬 기하학적 변환을 회전합니다.

RotateTransform(Single)

Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs

지정된 양만큼 로컬 기하학적 변환을 회전합니다. 이 메서드는 변환 앞에 회전을 추가합니다.

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

매개 변수

angle
Single

회전 각도(익스텐트)입니다.

예제

예제를 보려면 RotateTransform를 참조하세요.

적용 대상

RotateTransform(Single, MatrixOrder)

Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs
Source:
PathGradientBrush.cs

지정된 순서로 지정된 양만큼 로컬 기하학적 변환을 회전합니다.

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

회전 행렬을 추가할지 아니면 앞에 추가할지 여부를 지정하는 A MatrixOrder 입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 개체인 eOnPaint가 필요합니다. 코드는 다음 작업을 수행합니다.

  • 그래픽 경로를 만들고 사각형을 추가합니다.

  • 경로 지점에서 만듭니 PathGradientBrush 다(이 예제에서는 점이 사각형을 형성하지만 대부분의 셰이프일 수 있음).

  • 가운데 색을 빨강으로 설정하고 주변 색을 파랑으로 설정합니다.

  • PathGradientBrush 회전 변환을 적용하기 전에 화면에 그립니다.

  • 해당 메서드를 사용하여 브러시에 회전 변환을 적용합니다 RotateTransform .

  • 회전된 브러시(사각형)를 화면에 그립니다.

아래쪽 사각형은 변환 전에 그린 사각형과 비교하여 45도 회전됩니다.

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

적용 대상