TextureBrush.MultiplyTransform 方法

定義

依照指定的順序,根據指定的 Matrix 物件來乘以代表這個 TextureBrush 物件之局部幾何轉換的 Matrix 物件。

多載

MultiplyTransform(Matrix, MatrixOrder)

依照指定的順序,根據指定的 Matrix 物件來乘以代表這個 TextureBrush 物件之局部幾何轉換的 Matrix 物件。

MultiplyTransform(Matrix)

藉由將指定的 Matrix 物件附加在前面,根據指定的 Matrix 物件來乘以代表這個 TextureBrush 物件之局部幾何轉換的 Matrix 物件。

MultiplyTransform(Matrix, MatrixOrder)

來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs

依照指定的順序,根據指定的 Matrix 物件來乘以代表這個 TextureBrush 物件之局部幾何轉換的 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

MatrixOrder 列舉,指定要乘以兩個矩陣的順序。

範例

下列範例是專為搭配Windows Forms使用而設計,而且需要 PaintEventArgse ,這是事件處理常式的參數 Paint 。 此程式碼會執行下列動作:

  • 建立 TextureBrush 物件。

  • 建立新的矩陣,指定 X 方向 50 單位的轉譯。

  • 將矩陣與紋理筆刷的轉換矩陣相乘。

  • 使用紋理筆刷填滿矩形。

void MultiplyTransform_Example2( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );

   // Create a transformation matrix.
   Matrix^ translateMatrix = gcnew Matrix;
   translateMatrix->Translate( 50, 0 );

   // Multiply the transformation matrix of tBrush by translateMatrix.
   tBrush->MultiplyTransform( translateMatrix );

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 110, 100, 100 );
}
public void MultiplyTransform_Example2(PaintEventArgs e)
{
             
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
             
    // Create a transformation matrix.
    Matrix translateMatrix = new Matrix();
    translateMatrix.Translate(50, 0);
             
    // Multiply the transformation matrix of tBrush by translateMatrix.
    tBrush.MultiplyTransform(translateMatrix);
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 110, 100, 100);
}
Public Sub MultiplyTransform_Example2(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))

    ' Create a transformation matrix.
    Dim translateMatrix As New Matrix
    translateMatrix.Translate(50, 0)

    ' Multiply the transformation matrix of tBrush by translateMatrix.
    tBrush.MultiplyTransform(translateMatrix)

    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 110, 100, 100)
End Sub

備註

物件的轉換矩陣 TextureBrush 會指定如何轉換定義紋理的影像。 例如,如果轉換矩陣指定順時針旋轉 90 度,紋理影像會順時針旋轉 90 度。

適用於

MultiplyTransform(Matrix)

來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs

藉由將指定的 Matrix 物件附加在前面,根據指定的 Matrix 物件來乘以代表這個 TextureBrush 物件之局部幾何轉換的 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 。 此程式碼會執行下列動作:

  • 建立 TextureBrush 物件。

  • 建立新的矩陣,指定 X 方向 50 單位的轉譯。

  • 將矩陣與紋理筆刷的轉換矩陣相乘。

  • 使用紋理筆刷填滿矩形。

public:
   void MultiplyTransform_Example1( PaintEventArgs^ e )
   {
      // Create a TextureBrush object.
      TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );

      // Create a transformation matrix.
      Matrix^ translateMatrix = gcnew Matrix;
      translateMatrix->Translate( 50, 0 );

      // Multiply the transformation matrix of tBrush by translateMatrix.
      tBrush->MultiplyTransform( translateMatrix, MatrixOrder::Prepend );

      // Fill a rectangle with tBrush.
      e->Graphics->FillRectangle( tBrush, 0, 110, 100, 100 );
   }
public void MultiplyTransform_Example1(PaintEventArgs e)
{
             
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
             
    // Create a transformation matrix.
    Matrix translateMatrix = new Matrix();
    translateMatrix.Translate(50, 0);
             
    // Multiply the transformation matrix of tBrush by translateMatrix.
    tBrush.MultiplyTransform(translateMatrix, MatrixOrder.Prepend);
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 110, 100, 100);
}
Public Sub MultiplyTransform_Example1(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))

    ' Create a transformation matrix.
    Dim translateMatrix As New Matrix
    translateMatrix.Translate(50, 0)

    ' Multiply the transformation matrix of tBrush by translateMatrix.
    tBrush.MultiplyTransform(translateMatrix, MatrixOrder.Prepend)

    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 110, 100, 100)
End Sub

備註

物件的轉換矩陣 TextureBrush 會指定如何轉換定義紋理的影像。 例如,如果轉換矩陣指定順時針旋轉 90 度,紋理影像會順時針旋轉 90 度。

適用於