Graphics.MultiplyTransform 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
오버로드
| Name | Description |
|---|---|
| MultiplyTransform(Matrix) | |
| MultiplyTransform(Matrix, MatrixOrder) |
MultiplyTransform(Matrix)
public:
void MultiplyTransform(System::Drawing::Drawing2D::Matrix ^ matrix);
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix);
member this.MultiplyTransform : System.Drawing.Drawing2D.Matrix -> unit
Public Sub MultiplyTransform (matrix As Matrix)
매개 변수
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
행렬(
transformMatrix2-2개의 ID 행렬과 0번 변환 벡터)을 만듭니다.변환 행렬을 벡터(200, 100)로 변환합니다.
Windows Form의 월드 변환 매트릭스를 30도 회전하고 30도 회전 행렬 앞에 폼의 변환 행렬을 추가합니다.
회전된 월드 변환 매트릭스를 번역된
transformMatrix값으로 곱하고 월드 변환 행렬 앞에 추가합니다transformMatrix.회전된 번역된 타원을 그립니다.
public:
void MultiplyTransformMatrix( PaintEventArgs^ e )
{
// Create transform matrix.
Matrix^ transformMatrix = gcnew Matrix;
// Translate matrix, prepending translation vector.
transformMatrix->Translate( 200.0F, 100.0F );
// Rotate transformation matrix of graphics object,
// prepending rotation matrix.
e->Graphics->RotateTransform( 30.0F );
// Multiply (prepend to) transformation matrix of
// graphics object to translate graphics transformation.
e->Graphics->MultiplyTransform( transformMatrix );
// Draw rotated, translated ellipse.
e->Graphics->DrawEllipse( gcnew Pen( Color::Blue,3.0f ), -80, -40, 160, 80 );
}
private void MultiplyTransformMatrix(PaintEventArgs e)
{
// Create transform matrix.
Matrix transformMatrix = new Matrix();
// Translate matrix, prepending translation vector.
transformMatrix.Translate(200.0F, 100.0F);
// Rotate transformation matrix of graphics object,
// prepending rotation matrix.
e.Graphics.RotateTransform(30.0F);
// Multiply (prepend to) transformation matrix of
// graphics object to translate graphics transformation.
e.Graphics.MultiplyTransform(transformMatrix);
// Draw rotated, translated ellipse.
e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);
}
Private Sub MultiplyTransformMatrix(ByVal e As PaintEventArgs)
' Create transform matrix.
Dim transformMatrix As New Matrix
' Translate matrix, prepending translation vector.
transformMatrix.Translate(200.0F, 100.0F)
' Rotate transformation matrix of graphics object,
' prepending rotation matrix.
e.Graphics.RotateTransform(30.0F)
' Multiply (prepend to) transformation matrix of
' graphics object to translate graphics transformation.
e.Graphics.MultiplyTransform(transformMatrix)
' Draw rotated, translated ellipse.
e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), -80, -40, 160, 80)
End Sub
설명
이 메서드는 매개 변수에 지정된 matrix 행렬 앞에 추가되므로 결과는 x world 변환입니다 matrix .
추가 정보
적용 대상
MultiplyTransform(Matrix, MatrixOrder)
public:
void MultiplyTransform(System::Drawing::Drawing2D::Matrix ^ matrix, System::Drawing::Drawing2D::MatrixOrder order);
public void MultiplyTransform(System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.MatrixOrder order);
member this.MultiplyTransform : System.Drawing.Drawing2D.Matrix * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub MultiplyTransform (matrix As Matrix, order As MatrixOrder)
매개 변수
- order
- MatrixOrder
곱셈 순서 MatrixOrder 를 결정하는 열거형의 멤버입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 PaintEventArgs 이벤트 처리기의 매개 변수인 ePaint 필요합니다. 코드는 다음 작업을 수행합니다.
행렬(
transformMatrix2-2개의 ID 행렬과 0번 변환 벡터)을 만듭니다.변환 행렬을 벡터(200, 100)로 변환합니다.
Windows Form의 월드 변환 매트릭스를 30도 회전하고 30도 회전 행렬을 폼의 변환 행렬 앞에 추가합니다.
회전된 월드 변환 매트릭스를 변환된
transformMatrix세계 변환 행렬에transformMatrix추가하여 곱합니다.회전된 번역된 타원을 그립니다.
public:
void MultiplyTransformMatrixOrder( PaintEventArgs^ e )
{
// Create transform matrix.
Matrix^ transformMatrix = gcnew Matrix;
// Translate matrix, prepending translation vector.
transformMatrix->Translate( 200.0F, 100.0F );
// Rotate transformation matrix of graphics object,
// prepending rotation matrix.
e->Graphics->RotateTransform( 30.0F );
// Multiply (append to) transformation matrix of
// graphics object to translate graphics transformation.
e->Graphics->MultiplyTransform( transformMatrix, MatrixOrder::Append );
// Draw rotated, translated ellipse.
e->Graphics->DrawEllipse( gcnew Pen( Color::Blue,3.0f ), -80, -40, 160, 80 );
}
private void MultiplyTransformMatrixOrder(PaintEventArgs e)
{
// Create transform matrix.
Matrix transformMatrix = new Matrix();
// Translate matrix, prepending translation vector.
transformMatrix.Translate(200.0F, 100.0F);
// Rotate transformation matrix of graphics object,
// prepending rotation matrix.
e.Graphics.RotateTransform(30.0F);
// Multiply (append to) transformation matrix of
// graphics object to translate graphics transformation.
e.Graphics.MultiplyTransform(transformMatrix, MatrixOrder.Append);
// Draw rotated, translated ellipse.
e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);
}
Private Sub MultiplyTransformMatrixOrder(ByVal e As PaintEventArgs)
' Create transform matrix.
Dim transformMatrix As New Matrix
' Translate matrix, prepending translation vector.
transformMatrix.Translate(200.0F, 100.0F)
' Rotate transformation matrix of graphics object,
' prepending rotation matrix.
e.Graphics.RotateTransform(30.0F)
' Multiply (append to) transformation matrix of
' graphics object to translate graphics transformation.
e.Graphics.MultiplyTransform(transformMatrix, MatrixOrder.Append)
' Draw rotated, translated ellipse.
e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), -80, -40, 160, 80)
End Sub
설명
매개 변수의 Prependorder 값은 곱하기 순서가 x world 변환임을 matrix 지정합니다. 값은 Appendorder 곱하기 순서가 world transformation x matrix임을 지정합니다.