Pen ::ResetTransform, méthode (gdipluspen.h)

La méthode Pen ::ResetTransform définit la matrice de transformation de monde de cet objet Pen sur la matrice d’identité.

Syntaxe

Status ResetTransform();

Valeur de retour

Type : État

Si la méthode réussit, elle retourne Ok, qui est un élément de l’énumération Status .

Si la méthode échoue, elle retourne l’un des autres éléments de l’énumération Ok .

Remarques

La matrice d’identité représente une transformation qui ne fait rien. Si la matrice de transformation de monde d’un objet Pen est la matrice d’identité, aucune transformation de monde n’est appliquée aux éléments dessinés à l’aide de cet objet Pen .

Exemples

L’exemple suivant crée un objet Pen , définit une matrice de mise à l’échelle sur le stylet et dessine un rectangle. Le code réinitialise ensuite la transformation du stylet et dessine un deuxième rectangle.

VOID Example_ResetTrans(HDC hdc)
{
   Graphics graphics(hdc);

   // Create a pen, and set its transformation.
   Pen pen(Color(255, 0, 0, 255), 2);
   pen.ScaleTransform(8, 4);

   // Draw a rectangle with the transformed pen.
   graphics.DrawRectangle(&pen, 50, 50, 150, 100);

   pen.ResetTransform();

   // Draw a rectangle with no pen transformation.
   graphics.DrawRectangle(&pen, 250, 50, 150, 100);
}

Configuration requise

Condition requise Valeur
Client minimal pris en charge Windows XP, Windows 2000 Professionnel [applications de bureau uniquement]
Serveur minimal pris en charge Windows 2000 Server [applications de bureau uniquement]
Plateforme cible Windows
En-tête gdipluspen.h (include Gdiplus.h)
Bibliothèque Gdiplus.lib
DLL Gdiplus.dll

Voir aussi

Systèmes de coordonnées et transformations

Matrice

Stylet

Pen ::GetTransform

Pen ::MultiplyTransform

Pen ::RotateTransform

Pen ::ScaleTransform

Pen ::SetTransform

Transformations