Graphics.MultiplyTransform Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
| Nom | Description |
|---|---|
| MultiplyTransform(Matrix, MatrixOrder) |
Multiplie la transformation du monde de ceci Graphics et spécifie l’ordre Matrix spécifié. |
| MultiplyTransform(Matrix) |
Multiplie la transformation mondiale de ceci Graphics et spécifie le Matrix. |
MultiplyTransform(Matrix, MatrixOrder)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
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
- order
- MatrixOrder
Membre de l’énumération MatrixOrder qui détermine l’ordre de la 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 une
transformMatrixmatrice (deux par deux matrices d’identité, ainsi qu’un vecteur de traduction nulle).Traduit la matrice de transformation par un vecteur (200, 100).
Fait pivoter la matrice de transformation du monde du Windows Form de 30 degrés, ce qui précède la matrice de rotation de 30 degrés à la matrice de transformation du formulaire.
Multiplie la matrice de transformation du monde pivotée par le traduit
transformMatrix, ajoutant latransformMatrixmatrice de transformation mondiale.Dessine un ellipse pivoté et traduit.
public:
void MultiplyTransformMatrixOrder( PaintEventArgs^ e )
{
// Create transform matrix.
Matrix^ transformMatrix = gcnew Matrix;
// Translate matrix, prepending translation vector.
transformMatrix->Translate( 200.0F, 100.0F );
// Rotate transformation matrix of graphics object,
// prepending rotation matrix.
e->Graphics->RotateTransform( 30.0F );
// Multiply (append to) transformation matrix of
// graphics object to translate graphics transformation.
e->Graphics->MultiplyTransform( transformMatrix, MatrixOrder::Append );
// Draw rotated, translated ellipse.
e->Graphics->DrawEllipse( gcnew Pen( Color::Blue,3.0f ), -80, -40, 160, 80 );
}
private void MultiplyTransformMatrixOrder(PaintEventArgs e)
{
// Create transform matrix.
Matrix transformMatrix = new Matrix();
// Translate matrix, prepending translation vector.
transformMatrix.Translate(200.0F, 100.0F);
// Rotate transformation matrix of graphics object,
// prepending rotation matrix.
e.Graphics.RotateTransform(30.0F);
// Multiply (append to) transformation matrix of
// graphics object to translate graphics transformation.
e.Graphics.MultiplyTransform(transformMatrix, MatrixOrder.Append);
// Draw rotated, translated ellipse.
e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);
}
Private Sub MultiplyTransformMatrixOrder(ByVal e As PaintEventArgs)
' Create transform matrix.
Dim transformMatrix As New Matrix
' Translate matrix, prepending translation vector.
transformMatrix.Translate(200.0F, 100.0F)
' Rotate transformation matrix of graphics object,
' prepending rotation matrix.
e.Graphics.RotateTransform(30.0F)
' Multiply (append to) transformation matrix of
' graphics object to translate graphics transformation.
e.Graphics.MultiplyTransform(transformMatrix, MatrixOrder.Append)
' Draw rotated, translated ellipse.
e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), -80, -40, 160, 80)
End Sub
Remarques
Une valeur du Prependorder paramètre spécifie que l’ordre de la multiplication est matrix la transformation du monde x. Valeur de Append spécifiant order que l’ordre de la multiplication est la transformation du monde x matrix.
Voir aussi
S’applique à
MultiplyTransform(Matrix)
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
- Source:
- Graphics.cs
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
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 une
transformMatrixmatrice (deux par deux matrices d’identité, ainsi qu’un vecteur de traduction nulle).Traduit la matrice de transformation par un vecteur (200, 100).
Fait pivoter la matrice de transformation du monde du Windows Form de 30 degrés, prépendait la matrice de rotation pour 30 degrés à la matrice de transformation du formulaire.
Multiplie la matrice de transformation du monde pivotée par le traduit
transformMatrix, et prépende latransformMatrixmatrice de transformation mondiale.Dessine un ellipse pivoté et traduit.
public:
void MultiplyTransformMatrix( PaintEventArgs^ e )
{
// Create transform matrix.
Matrix^ transformMatrix = gcnew Matrix;
// Translate matrix, prepending translation vector.
transformMatrix->Translate( 200.0F, 100.0F );
// Rotate transformation matrix of graphics object,
// prepending rotation matrix.
e->Graphics->RotateTransform( 30.0F );
// Multiply (prepend to) transformation matrix of
// graphics object to translate graphics transformation.
e->Graphics->MultiplyTransform( transformMatrix );
// Draw rotated, translated ellipse.
e->Graphics->DrawEllipse( gcnew Pen( Color::Blue,3.0f ), -80, -40, 160, 80 );
}
private void MultiplyTransformMatrix(PaintEventArgs e)
{
// Create transform matrix.
Matrix transformMatrix = new Matrix();
// Translate matrix, prepending translation vector.
transformMatrix.Translate(200.0F, 100.0F);
// Rotate transformation matrix of graphics object,
// prepending rotation matrix.
e.Graphics.RotateTransform(30.0F);
// Multiply (prepend to) transformation matrix of
// graphics object to translate graphics transformation.
e.Graphics.MultiplyTransform(transformMatrix);
// Draw rotated, translated ellipse.
e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);
}
Private Sub MultiplyTransformMatrix(ByVal e As PaintEventArgs)
' Create transform matrix.
Dim transformMatrix As New Matrix
' Translate matrix, prepending translation vector.
transformMatrix.Translate(200.0F, 100.0F)
' Rotate transformation matrix of graphics object,
' prepending rotation matrix.
e.Graphics.RotateTransform(30.0F)
' Multiply (prepend to) transformation matrix of
' graphics object to translate graphics transformation.
e.Graphics.MultiplyTransform(transformMatrix)
' Draw rotated, translated ellipse.
e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), -80, -40, 160, 80)
End Sub
Remarques
Cette méthode précède la matrice spécifiée par le matrix paramètre, afin que le résultat soit matrix une transformation du monde x.