Help Center

CGpGraphicsPath.GetPathTypesmethod

Gets this path's array of point types.

GraphicsmethodCGpPath.incdocumented

Syntax

FUNCTION GetPathTypes (BYVAL types AS BYTE PTR, BYVAL count AS INT_) AS GpStatus

Parameters

NameDescription
typesPointer to an array that receives the point types. You must allocate memory for this array. You can call the GetPointCount method to determine the required size of the array.
countInteger that specifies the number of elements in the types array. Set this parameter equal to the return value of the GetPointCount method.

Return value

If the function succeeds, it returns StatusOk, which is an element of the GpStatus enumeration.

If the function fails, it returns one of the other elements of the GpStatus enumeration.

Description

Gets this path's array of point types.

Remarks

A GraphicsPath object has an array of points and an array of types. Each element in the array of types is a byte that specifies the point type and a set of flags for the corresponding element in the array of points. Possible point types and flags are listed in the PathPointType enumeration.

Example

' ======================================================================================== ' This example retrieves the types of each point in a GraphicsPath. ' ======================================================================================== SUB Example_GetPathTypes (BYVAL hdc AS HDC)

' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi

' // Create path and add a rectangle DIM path AS CGpGraphicsPath path.AddRectangle(100, 80, 150, 100)

' // Get number of points DIM count AS LONG = path.GetPointCount

' // Retrieve point types DIM types(ANY) AS BYTE REDIM types(count - 1) path.GetPathTypes(@types(0), count)

' // Output each point type FOR i AS LONG = 0 TO count - 1

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

NEXT

' // Create pen and draw path DIM pen AS CGpPen = CGpPen(ARGB_ORANGE, 2.0, UnitWorld) graphics.DrawPath(@pen, @path)

END SUB ' ========================================================================================

Reference

  • Include file CGpPath.inc
  • Defined in AfxNova/CGpPath.inc:553
  • Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
  • Topic: CGpGraphics Class