Pen::ResetTransform method (gdipluspen.h)
The Pen::ResetTransform method sets the world transformation matrix of this Pen 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 Ok enumeration.
Remarks
The identity matrix represents a transformation that does nothing. If the world transformation matrix of a Pen object is the identity matrix, then no world transformation is applied to items drawn using that Pen object.
Examples
The following example creates a Pen object, sets a scaling matrix to the pen, and draws a rectangle. The code then resets the transformation of the pen and draws a second rectangle.
VOID Example_ResetTrans(HDC hdc)
{
Graphics graphics(hdc);
// Create a pen, and set its transformation.
Pen pen(Color(255, 0, 0, 255), 2);
pen.ScaleTransform(8, 4);
// Draw a rectangle with the transformed pen.
graphics.DrawRectangle(&pen, 50, 50, 150, 100);
pen.ResetTransform();
// Draw a rectangle with no pen transformation.
graphics.DrawRectangle(&pen, 250, 50, 150, 100);
}
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 | gdipluspen.h (include Gdiplus.h) |
Library | Gdiplus.lib |
DLL | Gdiplus.dll |