Pen.MultiplyTransform Méthode

Définition

Multiplie la matrice de transformation pour cela Pen par le paramètre spécifié Matrix.

Surcharges

Nom Description
MultiplyTransform(Matrix)

Multiplie la matrice de transformation pour cela Pen par le paramètre spécifié Matrix.

MultiplyTransform(Matrix, MatrixOrder)

Multiplie la matrice de transformation pour cela Pen par l’ordre spécifié Matrix .

MultiplyTransform(Matrix)

Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs

Multiplie la matrice de transformation pour cela Pen par le paramètre spécifié 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)

Paramètres

matrix
Matrix

Objet Matrix par lequel multiplier la matrice de transformation.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms, et nécessite PaintEventArgse, qui est un paramètre du gestionnaire d’événements Paint. Le code effectue les actions suivantes :

  • Crée un Pen.

  • Dessine une ligne à l’écran.

  • Multiplie la matrice de transformation du stylet par la matrice spécifiée.

  • Dessine une ligne avec le stylet transformé.

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

Remarques

Cette méthode précède la matrice de multiplication spécifiée dans le paramètre dans la matrix matrice de transformation pour l’opération de multiplication.

S’applique à

MultiplyTransform(Matrix, MatrixOrder)

Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs
Source:
Pen.cs

Multiplie la matrice de transformation pour cela Pen par l’ordre spécifié 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)

Paramètres

matrix
Matrix

Par Matrix lequel multiplier la matrice de transformation.

order
MatrixOrder

Ordre dans lequel effectuer l’opération de multiplication.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms, et nécessite PaintEventArgse, qui est un paramètre du gestionnaire d’événements Paint. Le code effectue les actions suivantes :

  • Crée un Pen.

  • Dessine une ligne à l’écran.

  • Multiplie la matrice de transformation du stylet par la matrice spécifiée.

  • Dessine une ligne avec le stylet transformé.

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

Remarques

Cette méthode utilise l’élément MatrixOrder d’énumération (prépend ou append) spécifié par le order paramètre pour effectuer l’opération de multiplication.

S’applique à