Graphics.MultiplyTransform メソッド (Matrix)
アセンブリ: System.Drawing (system.drawing.dll 内)



次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
-
Windows フォームのワールド変換行列を 30 度回転して、30 度の回転行列を Windows フォームの変換行列の前に付加します。
-
回転したワールド変換行列と平行移動した transformMatrix を乗算し、transformMatrix をワールド変換行列の前に付加します。
Public 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
public 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); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.MultiplyTransform メソッド (Matrix, MatrixOrder)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As Graphics Dim matrix As Matrix Dim order As MatrixOrder instance.MultiplyTransform(matrix, order)

order パラメータの Prepend の値は、乗算の順序を matrix × ワールド変換に指定します。order の Append の値は、乗算の順序を matrix × ワールド変換に指定します。

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
-
Windows フォームのワールド変換行列を 30 度回転して、30 度の回転行列を Windows フォームの変換行列の前に付加します。
-
回転したワールド変換行列と平行移動した transformMatrix を乗算し、transformMatrix をワールド変換行列に追加します。
Public 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
public 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); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.MultiplyTransform メソッド
- Graphics.MultiplyTransformのページへのリンク