Pen.ScaleTransform 메서드

정의

로컬 기하학적 변환을 지정된 인수만큼 크기를 조정합니다. 이 메서드는 변환에 크기 조정 매트릭스를 추가합니다.

오버로드

ScaleTransform(Single, Single)

로컬 기하학적 변환을 지정된 인수만큼 크기를 조정합니다. 이 메서드는 변환에 크기 조정 매트릭스를 추가합니다.

ScaleTransform(Single, Single, MatrixOrder)

로컬 기하학적 변환을 지정된 인수만큼 지정된 순서로 크기를 조정합니다.

ScaleTransform(Single, Single)

Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs

로컬 기하학적 변환을 지정된 인수만큼 크기를 조정합니다. 이 메서드는 변환에 크기 조정 매트릭스를 추가합니다.

public:
 void ScaleTransform(float sx, float sy);
public void ScaleTransform (float sx, float sy);
member this.ScaleTransform : single * single -> unit
Public Sub ScaleTransform (sx As Single, sy As Single)

매개 변수

sx
Single

변환의 크기를 X 방향으로 조정하는 인수입니다.

sy
Single

변환의 크기를 Y 방향으로 조정하는 인수입니다.

예제

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

Pen을 만듭니다.

펜을 사용하여 사각형을 그립니다.

x축 방향으로 펜의 크기를 2배 조정합니다.

두 번째 사각형을 그려 차이점을 보여 줍니다.

public:
   void ScaleTransform_Example1( PaintEventArgs^ e )
   {
      
      // Create a Pen object.
      Pen^ scalePen = gcnew Pen( Color::Black,5.0f );
      
      // Draw a rectangle with scalePen.
      e->Graphics->DrawRectangle( scalePen, 10, 10, 100, 100 );
      
      // Scale scalePen by 2X in the x-direction.
      scalePen->ScaleTransform( 2, 1 );
      
      // Draw a second rectangle with rotatePen.
      e->Graphics->DrawRectangle( scalePen, 120, 10, 100, 100 );
   }
public void ScaleTransform_Example1(PaintEventArgs e)
{
             
    // Create a Pen object.
    Pen scalePen = new Pen(Color.Black, 5);
             
    // Draw a rectangle with scalePen.
    e.Graphics.DrawRectangle(scalePen, 10, 10, 100, 100);
             
    // Scale scalePen by 2X in the x-direction.
    scalePen.ScaleTransform(2, 1);
             
    // Draw a second rectangle with rotatePen.
    e.Graphics.DrawRectangle(scalePen, 120, 10, 100, 100);
}
Public Sub ScaleTransform_Example1(ByVal e As PaintEventArgs)

    ' Create a Pen object.
    Dim scalePen As New Pen(Color.Black, 5)

    ' Draw a rectangle with scalePen.
    e.Graphics.DrawRectangle(scalePen, 10, 10, 100, 100)

    ' Scale scalePen by 2X in the x-direction.
    scalePen.ScaleTransform(2, 1)

    ' Draw a second rectangle with rotatePen.
    e.Graphics.DrawRectangle(scalePen, 120, 10, 100, 100)
End Sub

적용 대상

ScaleTransform(Single, Single, MatrixOrder)

Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs

로컬 기하학적 변환을 지정된 인수만큼 지정된 순서로 크기를 조정합니다.

public:
 void ScaleTransform(float sx, float sy, System::Drawing::Drawing2D::MatrixOrder order);
public void ScaleTransform (float sx, float sy, System.Drawing.Drawing2D.MatrixOrder order);
member this.ScaleTransform : single * single * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub ScaleTransform (sx As Single, sy As Single, order As MatrixOrder)

매개 변수

sx
Single

변환의 크기를 X 방향으로 조정하는 인수입니다.

sy
Single

변환의 크기를 Y 방향으로 조정하는 인수입니다.

order
MatrixOrder

크기 조정 매트릭스를 앞에 추가할 것인지 아니면 뒤에 추가할 것인지를 지정하는 MatrixOrder입니다.

예제

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

  • Pen을 만듭니다.

  • 펜을 사용하여 사각형을 그립니다.

  • x축 방향으로 펜의 크기를 2배 조정합니다.

  • 두 번째 사각형을 그려 차이점을 보여 줍니다.

public:
   void ScaleTransform_Example2( PaintEventArgs^ e )
   {
      
      // Create a Pen object.
      Pen^ scalePen = gcnew Pen( Color::Black,5.0f );
      
      // Draw a rectangle with scalePen.
      e->Graphics->DrawRectangle( scalePen, 10, 10, 100, 100 );
      
      // Scale scalePen by 2X in the x-direction.
      scalePen->ScaleTransform( 2, 1, MatrixOrder::Prepend );
      
      // Draw a second rectangle with rotatePen.
      e->Graphics->DrawRectangle( scalePen, 120, 10, 100, 100 );
   }
public void ScaleTransform_Example2(PaintEventArgs e)
{
             
    // Create a Pen object.
    Pen scalePen = new Pen(Color.Black, 5);
             
    // Draw a rectangle with scalePen.
    e.Graphics.DrawRectangle(scalePen, 10, 10, 100, 100);
             
    // Scale scalePen by 2X in the x-direction.
    scalePen.ScaleTransform(2, 1, MatrixOrder.Prepend);
             
    // Draw a second rectangle with rotatePen.
    e.Graphics.DrawRectangle(scalePen, 120, 10, 100, 100);
}
Public Sub ScaleTransform_Example2(ByVal e As PaintEventArgs)

    ' Create a Pen object.
    Dim scalePen As New Pen(Color.Black, 5)

    ' Draw a rectangle with scalePen.
    e.Graphics.DrawRectangle(scalePen, 10, 10, 100, 100)

    ' Scale scalePen by 2X in the x-direction.
    scalePen.ScaleTransform(2, 1, MatrixOrder.Prepend)

    ' Draw a second rectangle with rotatePen.
    e.Graphics.DrawRectangle(scalePen, 120, 10, 100, 100)
End Sub

적용 대상