Graphics::ResetTransform method (gdiplusgraphics.h)
The Graphics::ResetTransform method sets the world transformation matrix of this Graphics object to the identity matrix.
Syntax
Status ResetTransform();
Return value
Type: Status
If the method succeeds, it returns Ok, which is an element of the Status enumeration.
If the method fails, it returns one of the other elements of the Status enumeration.
Remarks
The identity matrix represents a transformation that does nothing. If the world transformation matrix of a Graphics object is the identity matrix, then no world transformation is applied to items drawn by that Graphics object.
Examples
The following example sets the world transformation of a Graphics object to a 45-degree rotation and then draws a rectangle. The code calls the ResetTransform method of the Graphics object and then draws a second rectangle. No rotation transformation is applied to the second 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);
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP, Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | gdiplusgraphics.h (include Gdiplus.h) |
Library | Gdiplus.lib |
DLL | Gdiplus.dll |