Help Center

CGpGraphics.RotateTransformmethod

Updates the world transformation matrix of this **Graphics** object with the product of itself and a rotation matrix.

GraphicsmethodCGpGraphics.incdocumented

Syntax

FUNCTION RotateTransform ( BYVAL angle AS SINGLE, BYVAL order AS MatrixOrder = MatrixOrderPrepend) AS GpStatus

Parameters

NameDescription
angleThe angle, in degrees, of rotation.
orderOptional. Element of the MatrixOrder enumeration that specifies the order of multiplication. MatrixOrderPrepend specifies that the passed matrix is on the left, and MatrixOrderAppend specifies that the passed matrix is on the right. The default value is MatrixOrderPrepend.

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

Updates the world transformation matrix of this Graphics object with the product of itself and a rotation matrix.

Example

' ======================================================================================== ' The following example sets the world transformation of a Graphics object to a translation. ' The call to Graphics.RotateTransform multiplies the Graphics object's existing world ' transformation matrix (translation) by a rotation matrix. The MatrixOrderAppend argument ' specifies that the multiplication is done with the rotation matrix on the right. At that ' point, the world transformation matrix of the Graphics object represents a composite ' transformation: first translate, then rotate. The call to DrawEllipse draws a translated ' and rotated ellipse. ' ======================================================================================== SUB Example_RotateTransform (BYVAL hdc AS HDC)

' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi

DIM redPen AS CGpPen = CGpPen(ARGB_RED) graphics.TranslateTransform(100, 0) ' // first translate graphics.RotateTransform(30, MatrixOrderAppend) ' // then rotate graphics.DrawEllipse(@redPen, 0, 0, 200, 80)

END SUB ' ========================================================================================

Reference

  • Include file CGpGraphics.inc
  • Defined in AfxNova/CGpGraphics.inc:329
  • Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
  • Topic: CGpGraphics Class