Help Center

GdipStartPathFigurefunction

Starts a new figure without closing the current figure. Subsequent points added to this path are added to the new figure.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipStartPathFigure (BYVAL path AS GpPath PTR) AS GpStatus

Parameters

NameDescription
path[in] Pointer to the GraphicsPath object.

Description

Starts a new figure without closing the current figure. Subsequent points added to this path are added to the new figure.

Example

' ======================================================================================== ' This example creates two separate figures in a path using GdipStartPathFigure. ' ======================================================================================== SUB Example_StartPathFigure (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 (rectangle) hStatus = GdipAddPathRectangle(path, 50, 50, 100, 60)

' // Start a new figure hStatus = GdipStartPathFigure(path)

' // Add second figure (ellipse) hStatus = GdipAddPathEllipse(path, 200, 50, 100, 60)

' // Draw path DIM pen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_DARKMAGENTA, 2, UnitWorld, @pen) 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:1997
  • Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
  • Topic: GraphicsPath Functions