Help Center

GdipGetPointCountfunction

Gets the number of points in this path's array of data points. This is the same as the number of types in the path's array of point types.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipGetPointCount (BYVAL path AS GpPath PTR, BYVAL count AS INT_ PTR) AS GpStatus

Parameters

NameDescription
path[in] Pointer to the GraphicsPath object.
count[out] Pointer to a variable thagt receives the number of points in the path's array of data points.

Description

Gets the number of points in this path's array of data points. This is the same as the number of types in the path's array of point types.

Example

' ======================================================================================== ' This example uses GdipGetPointCount to determine how many points are in a GraphicsPath. ' ======================================================================================== SUB Example_GetPointCount (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 hStatus = GdipAddPathRectangle(path, 100, 80, 150, 100)

' // Get number of points DIM count AS LONG hStatus = GdipGetPointCount(path, @count)

AfxMsg "Number of points in path: " & WSTR(count)

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

' // Draw the 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:1990
  • Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
  • Topic: GraphicsPath Functions