TextureBrush.MultiplyTransform Metoda

Definicja

Matrix Mnoży obiekt reprezentujący lokalną transformację geometryczną tego TextureBrush obiektu przez określony Matrix obiekt w określonej kolejności.

Przeciążenia

MultiplyTransform(Matrix, MatrixOrder)

Matrix Mnoży obiekt reprezentujący lokalną transformację geometryczną tego TextureBrush obiektu przez określony Matrix obiekt w określonej kolejności.

MultiplyTransform(Matrix)

Matrix Mnoży obiekt reprezentujący lokalną transformację geometryczną tego TextureBrush obiektu przez określony Matrix obiekt, poprzedzając określony Matrix obiekt.

MultiplyTransform(Matrix, MatrixOrder)

Źródło:
TextureBrush.cs
Źródło:
TextureBrush.cs
Źródło:
TextureBrush.cs

Matrix Mnoży obiekt reprezentujący lokalną transformację geometryczną tego TextureBrush obiektu przez określony Matrix obiekt w określonej kolejności.

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)

Parametry

matrix
Matrix

Matrix Obiekt, za pomocą którego należy pomnożyć transformację geometryczną.

order
MatrixOrder

MatrixOrder Wyliczenie określające kolejność, w której należy pomnożyć dwie macierze.

Przykłady

Poniższy przykład jest przeznaczony do użycia z Windows Forms i wymaga PaintEventArgseparametru Paint programu obsługi zdarzeń. Kod wykonuje następujące akcje:

  • Tworzy obiekt TextureBrush.

  • Tworzy nową macierz, która określa tłumaczenie 50 jednostek w kierunku x.

  • Mnoży macierz za pomocą macierzy przekształcenia pędzla tekstury.

  • Wypełnia prostokąt za pomocą pędzla tekstury.

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

Uwagi

Macierz przekształcania TextureBrush obiektu określa sposób przekształcania obrazu definiującego teksturę. Jeśli na przykład macierz przekształcania określa obrót 90 stopni zgodnie z ruchem wskazówek zegara, obraz tekstury jest obracany przez 90 stopni zgodnie z ruchem wskazówek zegara.

Dotyczy

MultiplyTransform(Matrix)

Źródło:
TextureBrush.cs
Źródło:
TextureBrush.cs
Źródło:
TextureBrush.cs

Matrix Mnoży obiekt reprezentujący lokalną transformację geometryczną tego TextureBrush obiektu przez określony Matrix obiekt, poprzedzając określony Matrix obiekt.

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)

Parametry

matrix
Matrix

Matrix Obiekt, za pomocą którego należy pomnożyć transformację geometryczną.

Przykłady

Poniższy przykład jest przeznaczony do użycia z Windows Forms i wymaga PaintEventArgseparametru Paint programu obsługi zdarzeń. Kod wykonuje następujące akcje:

  • Tworzy obiekt TextureBrush.

  • Tworzy nową macierz, która określa tłumaczenie 50 jednostek w kierunku x.

  • Mnoży macierz za pomocą macierzy przekształcenia pędzla tekstury.

  • Wypełnia prostokąt za pomocą pędzla tekstury.

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

Uwagi

Macierz przekształcania TextureBrush obiektu określa sposób przekształcania obrazu definiującego teksturę. Jeśli na przykład macierz przekształcania określa obrót 90 stopni zgodnie z ruchem wskazówek zegara, obraz tekstury jest obracany przez 90 stopni zgodnie z ruchem wskazówek zegara.

Dotyczy