語言

TextureBrush.MultiplyTransform 方法

定義

將 Matrix 代表該 TextureBrush 物件局部幾何變換的物件乘以指定順序的 Matrix 物件。

多載

名稱 Description
MultiplyTransform(Matrix, MatrixOrder)

將 Matrix 代表該 TextureBrush 物件局部幾何變換的物件乘以指定順序的 Matrix 物件。

MultiplyTransform(Matrix)

將 Matrix 代表該 TextureBrush 物件局部幾何變換的物件乘以指定的 Matrix 物件,並在指定 Matrix 物件前加。

MultiplyTransform(Matrix, MatrixOrder)

來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
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 表單設計,並需要 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
來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs
來源:
TextureBrush.cs

將 Matrix 代表該 TextureBrush 物件局部幾何變換的物件乘以指定的 Matrix 物件,並在指定 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 表單設計,並需要 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度。

適用於