Export (0) Print
Expand All

Graphics.ResetTransform Method

Resets the world transformation matrix of this Graphics to the identity matrix.

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

member ResetTransform : unit -> unit

The identity matrix represents a transformation with no scaling, rotation, or translation. Resetting the world transformation of this Graphics to the identity matrix means that its world transformation does not change the geometry of transformed items.

The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, 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.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft