Help Center

GdipAddPathPathfunction

Adds a path to this path.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipAddPathPath (BYVAL path AS GpPath PTR, BYVAL addingPath AS GpPath PTR, BYVAL connect AS BOOL) AS GpStatus

Parameters

NameDescription
path[in] Pointer to the GraphicsPath object.
addingPath[in] Pointer to the path to be added.
connect[in] Boolean value that specifies whether the first figure in the added path is part of the last figure in this path. TRUE: Specifies that (if possible) the first figure in the added path is part of the last figure in this path. FALSE: Specifies that the first figure in the added path is separate from the last figure in this path.

Description

Adds a path to the path.

Example

' ======================================================================================== ' This example combines two GraphicsPath objects using GdipAddPathPath. ' ======================================================================================== SUB Example_DrawPathPath (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 base path DIM basePath AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @basePath) hStatus = GdipAddPathEllipse(basePath, 120, 70, 150, 100)

' // Create another path to add DIM subPath AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @subPath) hStatus = GdipAddPathRectangle(subPath, 150, 100, 90, 40)

' // Merge subPath into basePath DIM connect AS BOOL = FALSE ' FALSE = separate figure hStatus = GdipAddPathPath(basePath, subPath, connect)

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

' // Draw combined path hStatus = GdipDrawPath(graphics, pen, basePath)

' // Cleanup IF pen THEN GdipDeleteBrush(pen) IF subPath THEN GdipDeletePath(subPath) IF basePath THEN GdipDeletePath(basePath) IF graphics THEN GdipDeleteGraphics(graphics)

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

Reference

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