다음을 통해 공유


Graphics.RotateTransform 메서드

정의

지정된 회전을 이 Graphics변환 행렬에 적용합니다.

오버로드

RotateTransform(Single)

지정된 회전을 이 Graphics변환 행렬에 적용합니다.

RotateTransform(Single, MatrixOrder)

지정된 순서대로 이 Graphics 변환 행렬에 지정된 회전을 적용합니다.

RotateTransform(Single)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

지정된 회전을 이 Graphics변환 행렬에 적용합니다.

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에서 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse필요합니다. 코드는 다음 작업을 수행합니다.

  • Windows Form의 월드 변환 매트릭스를 벡터(100, 0)로 변환합니다.

  • 세계 변환을 30도 각도로 회전하고 회전 행렬을 월드 변환 매트릭스 앞에 추가합니다.

  • 파란색 펜으로 회전된 번역된 타원을 그립니다.

public:
   void RotateTransformAngle( PaintEventArgs^ e )
   {
      // Set world transform of graphics object to translate.
      e->Graphics->TranslateTransform( 100.0F, 0.0F );

      // Then to rotate, prepending rotation matrix.
      e->Graphics->RotateTransform( 30.0F );

      // Draw rotated, translated ellipse to screen.
      e->Graphics->DrawEllipse( gcnew Pen( Color::Blue,3.0f ), 0, 0, 200, 80 );
   }
private void RotateTransformAngle(PaintEventArgs e)
{

    // Set world transform of graphics object to translate.
    e.Graphics.TranslateTransform(100.0F, 0.0F);

    // Then to rotate, prepending rotation matrix.
    e.Graphics.RotateTransform(30.0F);

    // Draw rotated, translated ellipse to screen.
    e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
}
Private Sub RotateTransformAngle(ByVal e As PaintEventArgs)

    ' Set world transform of graphics object to translate.
    e.Graphics.TranslateTransform(100.0F, 0.0F)

    ' Then to rotate, prepending rotation matrix.
    e.Graphics.RotateTransform(30.0F)

    ' Draw rotated, translated ellipse to screen.
    e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), 0, 0, 200, 80)
End Sub

설명

회전 작업은 요소가 angle 매개 변수에서 파생된 행렬을 통해 변환 행렬을 곱하는 것으로 구성됩니다. 이 메서드는 변환 매트릭스 앞에 추가하여 회전을 적용합니다.

적용 대상

RotateTransform(Single, MatrixOrder)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

지정된 순서대로 이 Graphics 변환 행렬에 지정된 회전을 적용합니다.

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에서 사용하도록 설계되었으며 Paint 이벤트 처리기의 매개 변수인 PaintEventArgse필요합니다. 코드는 다음 작업을 수행합니다.

  • Windows Form의 월드 변환 매트릭스를 벡터(100, 0)로 변환합니다.

  • 세계 변환을 30도 각도로 회전하고 회전 행렬을 Append사용하여 세계 변환 행렬에 추가합니다.

  • 파란색 펜으로 번역된 회전된 타원을 그립니다.

public:
   void RotateTransformAngleMatrixOrder( PaintEventArgs^ e )
   {
      // Set world transform of graphics object to translate.
      e->Graphics->TranslateTransform( 100.0F, 0.0F );

      // Then to rotate, appending rotation matrix.
      e->Graphics->RotateTransform( 30.0F, MatrixOrder::Append );

      // Draw translated, rotated ellipse to screen.
      e->Graphics->DrawEllipse( gcnew Pen( Color::Blue,3.0f ), 0, 0, 200, 80 );
   }
private void RotateTransformAngleMatrixOrder(PaintEventArgs e)
{

    // Set world transform of graphics object to translate.
    e.Graphics.TranslateTransform(100.0F, 0.0F);

    // Then to rotate, appending rotation matrix.
    e.Graphics.RotateTransform(30.0F, MatrixOrder.Append);

    // Draw translated, rotated ellipse to screen.
    e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
}
Private Sub RotateTransformAngleMatrixOrder(ByVal e As PaintEventArgs)

    ' Set world transform of graphics object to translate.
    e.Graphics.TranslateTransform(100.0F, 0.0F)

    ' Then to rotate, appending rotation matrix.
    e.Graphics.RotateTransform(30.0F, MatrixOrder.Append)

    ' Draw translated, rotated ellipse to screen.
    e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), 0, 0, 200, 80)
End Sub

설명

회전 작업은 요소가 angle 매개 변수에서 파생된 행렬을 통해 변환 행렬을 곱하는 것으로 구성됩니다. 이 메서드는 order 매개 변수에 따라 회전 행렬에 의해 Graphics 변환 매트릭스를 앞에 추가하거나 추가합니다.

적용 대상