Pen.ResetTransform 메서드

정의

Pen에 대한 기하학적 변환 매트릭스를 항등으로 다시 설정합니다.

public:
 void ResetTransform();
public void ResetTransform ();
member this.ResetTransform : unit -> unit
Public Sub ResetTransform ()

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • Pen을 만듭니다.

  • 펜의 변환 행렬을 x축 방향으로 2배 크기 조정하도록 설정합니다.

  • 화면에 선을 그립니다.

  • 변환 매트릭스를 ID로 다시 설정합니다.

  • 화면에 두 번째 선을 그립니다.

public:
   void ResetTransform_Example( PaintEventArgs^ e )
   {
      
      // Create a Pen object.
      Pen^ myPen = gcnew Pen( Color::Black,3.0f );
      
      // Scale the transformation matrix of myPen.
      myPen->ScaleTransform( 2, 1 );
      
      // Draw a line with myPen.
      e->Graphics->DrawLine( myPen, 10, 0, 10, 200 );
      
      // Reset the transformation matrix of myPen to identity.
      myPen->ResetTransform();
      
      // Draw a second line with myPen.
      e->Graphics->DrawLine( myPen, 100, 0, 100, 200 );
   }
public void ResetTransform_Example(PaintEventArgs e)
{
             
    // Create a Pen object.
    Pen myPen = new Pen(Color.Black, 3);
             
    // Scale the transformation matrix of myPen.
    myPen.ScaleTransform(2, 1);
             
    // Draw a line with myPen.
    e.Graphics.DrawLine(myPen, 10, 0, 10, 200);
             
    // Reset the transformation matrix of myPen to identity.
    myPen.ResetTransform();
             
    // Draw a second line with myPen.
    e.Graphics.DrawLine(myPen, 100, 0, 100, 200);
}
Public Sub ResetTransform_Example(ByVal e As PaintEventArgs)

    ' Create a Pen object.
    Dim myPen As New Pen(Color.Black, 3)

    ' Scale the transformation matrix of myPen.
    myPen.ScaleTransform(2, 1)

    ' Draw a line with myPen.
    e.Graphics.DrawLine(myPen, 10, 0, 10, 200)

    ' Reset the transformation matrix of myPen to identity.
    myPen.ResetTransform()

    ' Draw a second line with myPen.
    e.Graphics.DrawLine(myPen, 100, 0, 100, 200)
End Sub

적용 대상