Help Center

GdipClonePathfunction

Creates a new **GraphicsPath** object, and initializes it with the contents of this **GraphicsPath** object.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipClonePath (BYVAL path AS GpPath PTR, BYVAL clonePath AS GpPath PTR) AS GpStatus

Parameters

NameDescription
path[in] Pointer to the GraphicsPath object.
clonePath[out] Pointer to the new GraphicsPath object.

Description

Creates a new GraphicsPath object, and initializes it with the contents of this GraphicsPath object.

Example

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

DIM hStatus AS LONG

' // Create a graphics object from the device context DIM graphics AS GpGraphics PTR hStatus = GdipCreateFromHDC(hdc, @graphics)

' // Get the DPI scaling ratios DIM dpiX AS SINGLE hStatus = GdipGetDpiX(graphics, @dpiX) DIM rxRatio AS SINGLE = dpiX / 96 DIM dpiY AS SINGLE hStatus = GdipGetDpiY(graphics, @dpiY) Dim ryRatio AS SINGLE = dpiY / 96 ' // Set the scale transform hStatus = GdipScaleWorldTransform(graphics, rxRatio, ryRatio, MatrixOrderPrepend)

' // Create original path DIM originalPath AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @originalPath) hStatus = GdipAddPathEllipse(originalPath, 120, 70, 150, 100)

' // Clone the path DIM clonedPath AS GpPath PTR hStatus = GdipClonePath(originalPath, @clonedPath)

' // Create pen DIM pen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_DARKORANGE, 2, UnitWorld, @pen)

' // Draw cloned path hStatus = GdipDrawPath(graphics, pen, clonedPath)

' // Cleanup IF pen THEN GdipDeleteBrush(pen) IF clonedPath THEN GdipDeletePath(clonedPath) IF originalPath THEN GdipDeletePath(originalPath) IF graphics THEN GdipDeleteGraphics(graphics)

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

Reference

  • Defined in AfxNova/AfxGdiPlus.bi:1987
  • Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
  • Topic: GraphicsPath Functions