Graphics.ResetTransform method

Applies to: desktop apps only

The Graphics::ResetTransform method sets the world transformation matrix of this Graphics object to the identity matrix.

Syntax

Status ResetTransform();

Parameters

This method has no parameters.

Return value

Type:

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

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics
Graphics::GetTransform
Matrix
MatrixOrder
Graphics::MultiplyTransform
Graphics::RotateTransform
Graphics::ScaleTransform
Graphics::SetTransform
Graphics::TransformPoints
Graphics::TranslateTransform
Transformations
Coordinate Systems and Transformations

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Show: