Help Center

GdipGetPathTypesfunction

Gets this path's array of points. The array contains the endpoints and control points of the lines and Bézier splines that are used to draw the path.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipGetPathTypes (BYVAL path AS GpPath PTR, BYVAL types AS BYTE PTR, BYVAL count AS INT_) AS GpStatus

Parameters

NameDescription
path[in] Pointer to the GraphicsPath object.
types[out] Pointer to an array that receives the point types. You must allocate memory for this array. You can call the GdipGetPointCount method to determine the required size of the array.
count[in] Long integer values that specifies the number of elements in the types array. Set this parameter equal to the return value of the GdipGetPointCount function.

Description

Gets this path's array of points. The array contains the endpoints and control points of the lines and Bézier splines that are used to draw the path.

Example

' ======================================================================================== ' This example retrieves the types of each point in a GraphicsPath using GdipGetPathTypes. ' ======================================================================================== SUB Example_GetPathTypes (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)

' // Allocate array for types DIM types(ANY) AS BYTE REDIM types(count - 1)

' // Retrieve types hStatus = GdipGetPathTypes(path, @types(0), count)

' // Display points FOR i AS LONG = 0 TO count - 1

OutputDebugStringW("Type " & WSTR(i) & ": (" & WSTR(types(i)) & ")")

NEXT

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