Graphics.MultiplyTransform メソッド

定義

この Graphics と指定した Matrix のワールド変換を乗算します。

オーバーロード

MultiplyTransform(Matrix)

この Graphics と指定した Matrix のワールド変換を乗算します。

MultiplyTransform(Matrix, MatrixOrder)

この Graphics と指定した Matrix のワールド変換を指定した順序で乗算します。

MultiplyTransform(Matrix)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

この Graphics と指定した 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)

パラメーター

matrix
Matrix

ワールド変換を乗算する 4 x 4 Matrix

次のコード例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • 行列を transformMatrix 作成します (2 つ 2 つの ID 行列に 0 変換ベクトルを加えたもの)。

  • 変換行列をベクトル (200、100) で変換します。

  • Windows フォームのワールド変換行列を 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 を付加して、結果が matrix x ワールド変換になるようにします。

こちらもご覧ください

適用対象

MultiplyTransform(Matrix, MatrixOrder)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

この Graphics と指定した Matrix のワールド変換を指定した順序で乗算します。

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)

パラメーター

matrix
Matrix

ワールド変換を乗算する 4 x 4 Matrix

order
MatrixOrder

乗算の順序を決定する MatrixOrder 列挙体のメンバー。

次のコード例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • 行列を transformMatrix 作成します (2 つ 2 つの ID 行列に 0 変換ベクトルを加えたもの)。

  • 変換行列をベクトル (200、100) で変換します。

  • Windows フォームのワールド変換マトリックスを 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

注釈

パラメーターの Prepend の値は order 、乗算 matrix の順序が x ワールド変換であることを指定します。 のorderAppendは、乗算の順序がワールド変換 x matrixであることを指定します。

こちらもご覧ください

適用対象