Help Center

CGpGraphicsPath.Clonemethod

Copies the contents of the existing **GraphicsPath** object into a new **GraphicsPath** object.

GraphicsmethodCGpPath.incdocumented

Syntax

FUNCTION Clone (BYVAL pCloneGraphicsPath AS CGpGraphicsPath PTR) AS GpStatus

Parameters

NameDescription
pCloneGraphicsPathPointer to a variable that will receive a pointer to the cloned GraphicsPath object.

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

Copies the contents of the existing GraphicsPath object into a new GraphicsPath object.

Example

' ======================================================================================== ' This example clones a GraphicsPath using the Clone method. ' ======================================================================================== SUB Example_ClonePath (BYVAL hdc AS HDC)

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

' // Create original path and add an ellipse DIM originalPath AS CGpGraphicsPath originalPath.AddEllipse(120, 70, 150, 100)

' // Clone the path DIM clonedPath AS CGpGraphicsPath originalPath.Clone(@clonedPath) ' // Alternate way ' DIM clonedPath AS CGpGraphicsPath = @originalPath

' // Create pen (UnitWorld to match path coordinates) DIM pen AS CGpPen = CGpPen(ARGB_DARKORANGE, 2.0, UnitWorld)

' // Draw the cloned path graphics.DrawPath(@pen, @clonedPath)

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

Reference

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