GdipClosePathFiguresfunction
Closes all open figures in this path.
Syntax
FUNCTION GdipClosePathFigures (BYVAL path AS GpPath PTR) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
path | [in] Pointer to the GraphicsPath object. |
Description
Closes all open figures in a path.
Example
' ======================================================================================== ' This example draws two open shapes and closes them using GdipClosePathFigures. ' ======================================================================================== SUB Example_CloseFigures (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 first figure (arc) hStatus = GdipAddPathArc(path, 100, 50, 100, 100, 0, 180)
' // Start new figure hStatus = GdipStartPathFigure(path)
' // Add second figure (line) hStatus = GdipAddPathLine(path, 250, 50, 350, 150)
' // Close all open figures hStatus = GdipClosePathFigures(path)
' // Create pen DIM pen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_DARKGREEN, 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:1999
- Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
- Topic: GraphicsPath Functions