Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The Graphics::ResetTransform method sets the world transformation matrix of this Graphics object to the identity matrix.
Status ResetTransform();
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.
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.
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);
}
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 |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today