Graphics.ResetTransform Method
Assembly: System.Drawing (in system.drawing.dll)
The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. The code performs the following actions:
-
Translates the world transform of the Windows Form by a vector (100, 0).
-
Saves the graphics state of the form.
-
Resets the world transform of the form to an identity and fills a rectangle with a solid red brush.
-
Restores the translated graphics state and fills a rectangle with a solid blue brush.
The result is an untranslated red-filled rectangle and a translated blue-filled rectangle.
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.