語言

Pen.MultiplyTransform 方法

定義

將此 Pen 轉換矩陣乘以指定的 Matrix。

多載

名稱 Description
MultiplyTransform(Matrix)

將此 Pen 轉換矩陣乘以指定的 Matrix。

MultiplyTransform(Matrix, MatrixOrder)

將此 Pen 轉換矩陣乘以 Matrix 指定順序的 。

MultiplyTransform(Matrix)

來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs

將此 Pen 轉換矩陣乘以指定的 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

將 Matrix 轉換矩陣相乘的物件。

範例

以下程式碼範例是為 Windows Forms 設計的,並需要 PaintEventArgse,這是 Paint 事件處理程序的參數。 此程式碼會執行下列動作:

  • 建立 Pen。

  • 在螢幕上畫了一條線。

  • 將筆的轉換矩陣乘以指定的矩陣。

  • 用變形筆劃出一條線。

public:
   void MultiplyTransform_Example1( PaintEventArgs^ e )
   {
      
      // Create a Pen object.
      Pen^ myPen = gcnew Pen( Color::Black,5.0f );
      
      // Create a translation matrix.
      Matrix^ penMatrix = gcnew Matrix;
      penMatrix->Scale( 3, 1 );
      
      // Multiply the transformation matrix of myPen by transMatrix.
      myPen->MultiplyTransform( penMatrix );
      
      // Draw a line to the screen.
      e->Graphics->DrawLine( myPen, 0, 0, 100, 100 );
   }
public void MultiplyTransform_Example1(PaintEventArgs e)
{
             
    // Create a Pen object.
    Pen myPen = new Pen(Color.Black, 5);
             
    // Create a translation matrix.
    Matrix penMatrix = new Matrix();
    penMatrix.Scale(3, 1);
             
    // Multiply the transformation matrix of myPen by transMatrix.
    myPen.MultiplyTransform(penMatrix);
             
    // Draw a line to the screen.
    e.Graphics.DrawLine(myPen, 0, 0, 100, 100);
}
Public Sub MultiplyTransform_Example1(ByVal e As PaintEventArgs)

    ' Create a Pen object.
    Dim myPen As New Pen(Color.Black, 5)

    ' Create a translation matrix.
    Dim penMatrix As New Matrix
    penMatrix.Scale(3, 1)

    ' Multiply the transformation matrix of myPen by transMatrix.
    myPen.MultiplyTransform(penMatrix)

    ' Draw a line to the screen.
    e.Graphics.DrawLine(myPen, 0, 0, 100, 100)
End Sub

備註

此方法將參數中 matrix 指定的乘法矩陣前置於乘法運算的轉換矩陣前。

適用於

MultiplyTransform(Matrix, MatrixOrder)

來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs
來源:
Pen.cs

將此 Pen 轉換矩陣乘以 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

乘 Matrix 以 乘變換矩陣。

order
MatrixOrder

乘法運算的順序。

範例

以下程式碼範例是為 Windows Forms 設計的,並需要 PaintEventArgse,這是 Paint 事件處理程序的參數。 此程式碼會執行下列動作:

  • 建立 Pen。

  • 在螢幕上畫了一條線。

  • 將筆的轉換矩陣乘以指定的矩陣。

  • 用變形筆劃出一條線。

public:
   void MultiplyTransform_Example2( PaintEventArgs^ e )
   {
      
      // Create a Pen object.
      Pen^ myPen = gcnew Pen( Color::Black,5.0f );
      
      // Create a translation matrix.
      Matrix^ penMatrix = gcnew Matrix;
      penMatrix->Scale( 3, 1 );
      
      // Multiply the transformation matrix of myPen by transMatrix.
      myPen->MultiplyTransform( penMatrix, MatrixOrder::Prepend );
      
      // Draw a line to the screen.
      e->Graphics->DrawLine( myPen, 0, 0, 100, 100 );
   }
public void MultiplyTransform_Example2(PaintEventArgs e)
{
             
    // Create a Pen object.
    Pen myPen = new Pen(Color.Black, 5);
             
    // Create a translation matrix.
    Matrix penMatrix = new Matrix();
    penMatrix.Scale(3, 1);
             
    // Multiply the transformation matrix of myPen by transMatrix.
    myPen.MultiplyTransform(penMatrix, MatrixOrder.Prepend);
             
    // Draw a line to the screen.
    e.Graphics.DrawLine(myPen, 0, 0, 100, 100);
}
Public Sub MultiplyTransform_Example2(ByVal e As PaintEventArgs)

    ' Create a Pen object.
    Dim myPen As New Pen(Color.Black, 5)

    ' Create a translation matrix.
    Dim penMatrix As New Matrix
    penMatrix.Scale(3, 1)

    ' Multiply the transformation matrix of myPen by transMatrix.
    myPen.MultiplyTransform(penMatrix, MatrixOrder.Prepend)

    ' Draw a line to the screen.
    e.Graphics.DrawLine(myPen, 0, 0, 100, 100)
End Sub

備註

此方法使用 MatrixOrder 參數 order 指定的列舉元素(前置或加碼)來執行乘法運算。

適用於