Graphics ::ResetTransform, méthode (gdiplusgraphics.h)

La méthode Graphics ::ResetTransform définit la matrice de transformation de monde de cet objet Graphics 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 Status .

Remarques

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

Exemples

L’exemple suivant définit la transformation du monde d’un objet Graphics sur une rotation de 45 degrés, puis dessine un rectangle. Le code appelle la méthode ResetTransform de l’objet Graphics , puis dessine un deuxième rectangle. Aucune transformation de rotation n’est appliquée au deuxième rectangle.

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

   // Rotate the transformation and draw a rectangle.
   graphics.RotateTransform(45.0f);
   Pen blackPen(Color(255, 0, 0, 0));
   graphics.DrawRectangle(&blackPen, 100, 0, 100, 50);

   // Reset the transformation to identity, and draw a second rectangle.
   graphics.ResetTransform();
   Pen redPen(Color(255, 255, 0, 0));
   graphics.DrawRectangle(&redPen, 110, 0, 100, 50);
}

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 gdiplusgraphics.h (include Gdiplus.h)
Bibliothèque Gdiplus.lib
DLL Gdiplus.dll

Voir aussi

Systèmes de coordonnées et transformations

Graphismes

Graphics ::GetTransform

Graphics ::MultiplyTransform

Graphics ::RotateTransform

Graphics ::ScaleTransform

Graphics ::SetTransform

Graphics ::TransformPoints

Graphics ::TranslateTransform

Matrice

MatrixOrder

Transformations