CGpGraphics.ResetTransformmethod
Sets the world transformation matrix of this Graphics object to the identity matrix.
Syntax
FUNCTION ResetTransform () AS GpStatus
Return value
If the function succeeds, it returns StatusOk, which is an element of the GpStatus enumeration.
If the function fails, it returns one of the other elements of the GpStatus enumeration.
Description
Sets the world transformation matrix of this Graphics object to the identity matrix.
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.
Example
' ======================================================================================== ' 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. ' ======================================================================================== SUB Example_ResetTransform (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi
' // Rotate the transformation and draw a rectangle. graphics.RotateTransform(45) DIM blackPen AS CGpPen = CGpPen(ARGB_BLACK) graphics.DrawRectangle(@blackPen, 100, 0, 100, 50)
' // Reset the transformation to identity, and draw a second rectangle. graphics.ResetTransform graphics.ScaleTransformForDpi DIM redPen AS CGpPen = CGpPen(ARGB_RED) graphics.DrawRectangle(@redPen, 110, 0, 100, 50)
END SUB ' ========================================================================================
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:281
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class