GraphicsPath::GetPathTypes method

The GraphicsPath::GetPathTypes method gets this path's array of point types.


Status GetPathTypes(
  BYTE *types,
  INT  count



Type: BYTE*

Pointer to an array that receives the point types. You must allocate memory for this array. You can call the GraphicsPath::GetPointCount method to determine the required size of the array.


Type: INT

Integer that specifies the number of elements in the types array. Set this parameter equal to the return value of the GraphicsPath::GetPointCount method.

Return Value

Type: Type: Status

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.


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.


The following example creates a path and adds a sequence of three connected lines to the path. The code calls the GraphicsPath::GetPointCount method to determine the number of bytes in the path's array of point types and then allocates a buffer large enough to hold that array. Then the code calls the GraphicsPath::GetPathTypes method to fill the buffer with the array of point types.

GraphicsPath path;
Point pts[] = {Point(0, 0), Point(2, 2), Point(3, 3), Point(0, 5)};
path.AddLines(pts, 4);
INT num = path.GetPointCount();
BYTE* pTypes = new BYTE[num];
path.GetPathTypes(pTypes, num);


Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdipluspath.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See Also

Clipping with a Region

Constructing and Drawing Paths

Creating a Path Gradient

GetPathPoints Methods