Help Center

GdipCreatePathfunction

Creates a **GraphicsPath** object and initializes the fill mode.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipCreatePath (BYVAL brushMode AS GpFillMode, BYVAL path AS GpPathPTR PTR) AS GpStatus

Parameters

NameDescription
brushMode[in] Element of the FillMode enumeration that specifies how areas are filled if the path intersects itself. The default value is FillModeAlternate.
path[out] Pointer to a variable that receives a pointer to the new GraphicsPath object.

Description

Creates a GraphicsPath object and initializes the fill mode.

Example

' ======================================================================================== ' This example creates a GraphicsPath and adds a shape to it. ' ======================================================================================== SUB Example_CreatePath (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 GraphicsPath DIM path AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @path)

' // Add a shape to the path hStatus = GdipAddPathEllipse(path, 120, 80, 150, 100)

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

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

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

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

Reference

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