Help Center

GdipSetPathFillModefunction

Sets the fill mode of this path.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipSetPathFillMode (BYVAL path AS GpPath PTR, BYVAL fillMode AS GpFillMode) AS GpStatus

Parameters

NameDescription
path[in] Pointer to the GraphicsPath object.
fillMode[in] Element of the FillMode enumeration that specifies how to fill areas when the path intersects itself.

Description

Sets the fill mode of this path.

Example

' ======================================================================================== ' This example sets the fill mode of a GraphicsPath using GdipSetPathFillMode. ' ======================================================================================== SUB Example_SetPathFillMode (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 overlapping shapes hStatus = GdipAddPathEllipse(path, 100, 80, 150, 100) hStatus = GdipAddPathEllipse(path, 130, 110, 150, 100)

' // Change fill mode to Winding hStatus = GdipSetPathFillMode(path, FillModeWinding)

' // Fill the path DIM brush AS GpSolidFill PTR hStatus = GdipCreateSolidFill(ARGB_LIGHTSKYBLUE, @brush) hStatus = GdipFillPath(graphics, brush, path)

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

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

Reference

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