Help Center

GdipClosePathFigurefunction

Closes the current figure of this path.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipClosePathFigure (BYVAL path AS GpPath PTR) AS GpStatus

Parameters

NameDescription
path[in] Pointer to the GraphicsPath object.

Description

Closes the current figure of a path.

Example

' ======================================================================================== ' This example draws an open arc and closes it using GdipClosePathFigure. ' ======================================================================================== SUB Example_CloseFigure (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 an arc (open by default) hStatus = GdipAddPathArc(path, 140, 15, 100, 150, 0, 180)

' // Close the figure (connects end point to start point) hStatus = GdipClosePathFigure(path)

' // Create pen DIM pen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_RED, 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:1998
  • Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
  • Topic: GraphicsPath Functions