Graphics.ScaleTransform 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
개체의 변환 매트릭스 앞에 추가하여 지정된 크기 조정 작업을 이 Graphics 변환 행렬에 적용합니다.
오버로드
| Name | Description |
|---|---|
| ScaleTransform(Single, Single) |
개체의 변환 매트릭스 앞에 추가하여 지정된 크기 조정 작업을 이 Graphics 변환 행렬에 적용합니다. |
| ScaleTransform(Single, Single, MatrixOrder) |
지정된 크기 조정 작업을 지정된 순서로 이 Graphics 변환 행렬에 적용합니다. |
ScaleTransform(Single, Single)
개체의 변환 매트릭스 앞에 추가하여 지정된 크기 조정 작업을 이 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 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
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)
지정된 크기 조정 작업을 지정된 순서로 이 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 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
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 변환 매트릭스를 앞에 추가하거나 추가합니다.