Help Center

CGpGraphicsPath.Transformmethod

Multiplies each of this path's data points by a specified matrix.

GraphicsmethodCGpPath.incdocumented

Syntax

FUNCTION Transform (BYVAL pMatrix AS CGpMatrix PTR) AS GpStatus

Parameters

NameDescription
pMatrixPointer to a Matrix object that specifies the transformation.

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

Multiplies each of this path's data points by a specified matrix.

Example

' ======================================================================================== ' The following example creates a path and adds two figures to that path. The first figure ' has three arcs, and the second figure has two arcs. The arcs within a figure are connected ' by straight lines, but there is no connecting line between the last arc in the first ' figure and the first arc in the second figure. ' ======================================================================================== SUB Example_Transform (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 path AS CGpGraphicsPath path.AddRectangle(40, 10, 200, 50)

' // Draw the path in blue before applying a transformation graphics.DrawPath(@CGpPen(ARGB_BLUE), @path)

' // Transform the path DIM matrix AS CGpMatrix matrix.Rotate(30.0) path.Transform(@matrix)

' // Draw the transformed path in red. graphics.DrawPath(@CGpPen(ARGB_RED), @path)

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

Reference

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