Pen.MultiplyTransform Metodo

Definizione

Moltiplica la matrice di trasformazione per questo Pen oggetto in base all'oggetto specificato Matrix.

Overload

Nome Descrizione
MultiplyTransform(Matrix)

Moltiplica la matrice di trasformazione per questo Pen oggetto in base all'oggetto specificato Matrix.

MultiplyTransform(Matrix, MatrixOrder)

Moltiplica la matrice di trasformazione per questo Pen oggetto in base all'oggetto specificato Matrix nell'ordine specificato.

MultiplyTransform(Matrix)

Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs

Moltiplica la matrice di trasformazione per questo Pen oggetto in base all'oggetto specificato 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)

Parametri

matrix
Matrix

Oggetto Matrix in base al quale moltiplicare la matrice di trasformazione.

Esempio

L'esempio di codice seguente è progettato per l'uso con Windows Forms e richiede PaintEventArgse, che è un parametro del gestore eventi Paint. Il codice esegue le azioni seguenti:

  • Crea un Pen.

  • Disegna una linea sullo schermo.

  • Moltiplica la matrice di trasformazione della penna in base alla matrice specificata.

  • Disegna una linea con la penna trasformata.

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

Commenti

Questo metodo antepone la matrice di moltiplicazione specificata nel matrix parametro alla matrice di trasformazione per l'operazione di moltiplicazione.

Si applica a

MultiplyTransform(Matrix, MatrixOrder)

Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs
Origine:
Pen.cs

Moltiplica la matrice di trasformazione per questo Pen oggetto in base all'oggetto specificato Matrix nell'ordine specificato.

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)

Parametri

matrix
Matrix

Oggetto Matrix in base al quale moltiplicare la matrice di trasformazione.

order
MatrixOrder

Ordine in cui eseguire l'operazione di moltiplicazione.

Esempio

L'esempio di codice seguente è progettato per l'uso con Windows Forms e richiede PaintEventArgse, che è un parametro del gestore eventi Paint. Il codice esegue le azioni seguenti:

  • Crea un Pen.

  • Disegna una linea sullo schermo.

  • Moltiplica la matrice di trasformazione della penna in base alla matrice specificata.

  • Disegna una linea con la penna trasformata.

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

Commenti

Questo metodo usa l'elemento MatrixOrder di enumerazione (anteporto o accodato) specificato dal order parametro per eseguire l'operazione di moltiplicazione.

Si applica a