Graphics.ScaleTransform 메서드

정의

변환 매트릭스를 개체의 변환 매트릭스에 미리 추가하여, 지정된 크기 조정 작업을 이 Graphics의 변환 매트릭스에 적용합니다.

오버로드

ScaleTransform(Single, Single)

변환 매트릭스를 개체의 변환 매트릭스에 미리 추가하여, 지정된 크기 조정 작업을 이 Graphics의 변환 매트릭스에 적용합니다.

ScaleTransform(Single, Single, MatrixOrder)

지정된 크기 조정 작업을 지정된 순서로 이 Graphics의 변환 매트릭스에 적용합니다.

ScaleTransform(Single, Single)

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

변환 매트릭스를 개체의 변환 매트릭스에 미리 추가하여, 지정된 크기 조정 작업을 이 Graphics의 변환 매트릭스에 적용합니다.

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 코드는 다음 작업을 수행합니다.

  • Windows Form의 월드 변환 매트릭스를 30도 회전합니다.

  • 배율 변환을 앞에 추가하여 x 방향에서 3의 배율과 y 방향으로 1의 배율로 행렬의 크기를 조정합니다.

  • 파란색 펜으로 크기가 조정된 회전된 사각형을 그립니다.

결과는 여전히 사각형입니다.

public:
   void ScaleTransformFloat( PaintEventArgs^ e )
   {
      // Set world transform of graphics object to rotate.
      e->Graphics->RotateTransform( 30.0F );

      // Then to scale, prepending to world transform.
      e->Graphics->ScaleTransform( 3.0F, 1.0F );

      // Draw scaled, rotated rectangle to screen.
      e->Graphics->DrawRectangle( gcnew Pen( Color::Blue,3.0f ), 50, 0, 100, 40 );
   }
private void ScaleTransformFloat(PaintEventArgs e)
{

    // Set world transform of graphics object to rotate.
    e.Graphics.RotateTransform(30.0F);

    // Then to scale, prepending to world transform.
    e.Graphics.ScaleTransform(3.0F, 1.0F);

    // Draw scaled, rotated rectangle to screen.
    e.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100, 40);
}
Private Sub ScaleTransformFloat(ByVal e As PaintEventArgs)

    ' Set world transform of graphics object to rotate.
    e.Graphics.RotateTransform(30.0F)

    ' Then to scale, prepending to world transform.
    e.Graphics.ScaleTransform(3.0F, 1.0F)

    ' Draw scaled, rotated rectangle to screen.
    e.Graphics.DrawRectangle(New Pen(Color.Blue, 3), 50, 0, 100, 40)
End Sub

설명

크기 조정 작업은 변환 매트릭스를 요소가 (sx, sy, 1)인 대각선 행렬을 곱하는 것으로 구성됩니다. 이 메서드는 크기 조정 매트릭스로 의 Graphics 변환 매트릭스 앞에 을 추가합니다.

적용 대상

ScaleTransform(Single, Single, MatrixOrder)

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

지정된 크기 조정 작업을 지정된 순서로 이 Graphics의 변환 매트릭스에 적용합니다.

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 코드는 다음 작업을 수행합니다.

  • Windows Form의 월드 변환 매트릭스를 30도 회전합니다.

  • 멤버와 함께 크기 조정 변환 Append 을 추가하여 x 방향에서 3의 배율과 y 방향으로 1의 배율로 행렬의 크기를 조정합니다.

  • 파란색 펜으로 회전된 크기 조정된 사각형을 그립니다.

결과는 병렬 이동입니다.

public:
   void ScaleTransformFloatMatrixOrder( PaintEventArgs^ e )
   {
      // Set world transform of graphics object to rotate.
      e->Graphics->RotateTransform( 30.0F );

      // Then to scale, appending to world transform.
      e->Graphics->ScaleTransform( 3.0F, 1.0F, MatrixOrder::Append );

      // Draw rotated, scaled rectangle to screen.
      e->Graphics->DrawRectangle( gcnew Pen( Color::Blue,3.0f ), 50, 0, 100, 40 );
   }
private void ScaleTransformFloatMatrixOrder(PaintEventArgs e)
{

    // Set world transform of graphics object to rotate.
    e.Graphics.RotateTransform(30.0F);

    // Then to scale, appending to world transform.
    e.Graphics.ScaleTransform(3.0F, 1.0F, MatrixOrder.Append);

    // Draw rotated, scaled rectangle to screen.
    e.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100, 40);
}
Private Sub ScaleTransformFloatMatrixOrder(ByVal e As PaintEventArgs)

    ' Set world transform of graphics object to rotate.
    e.Graphics.RotateTransform(30.0F)

    ' Then to scale, appending to world transform.
    e.Graphics.ScaleTransform(3.0F, 1.0F, MatrixOrder.Append)

    ' Draw rotated, scaled rectangle to screen.
    e.Graphics.DrawRectangle(New Pen(Color.Blue, 3), 50, 0, 100, 40)
End Sub

설명

크기 조정 작업은 변환 매트릭스를 요소가 (sx, sy, 1)인 대각선 행렬을 곱하는 것으로 구성됩니다. 이 메서드는 매개 변수에 따라 order 크기 조정 매트릭스로 의 Graphics 변환 매트릭스를 추가하거나 추가합니다.

적용 대상