int GetPath(hdc, lpPoints, lpTypes, nSize) | |||
HDC hdc; | |||
LPPOINT lpPoints; | |||
LPBYTE lpTypes; | |||
int nSize; |
The GetPath function gets all the lines and curves in a path.
hdc
Identifies the device context of the path.
lpPoints
Points to an array of POINTs in which the path vertices will be placed.
lpTypes
Points to an array of BYTEs in which the vertex types will be placed. Values will be one of the following:
Type | Meaning |
PT_MOVETO | Specifies that this point starts a disjoint figure. |
PT_LINETO | Specifies that a line is to be drawn from the previous point in the path to this point. |
PT_BEZIERTO | Specifies that this point is a control point or end-point for a Bezier curve. |
PT_BEZIERTO types always occur in sets of three. The point in the path immediately preceding them defines the start-point for the Bezier curve. The first two PT_BEZIERTO points are the control points, and the third PT_BEZIERTO point is the end-point. |
A PT_LINETO or PT_BEZIERTO type may be combined with the following flag (using the bit-wise operator OR) to indicate that the corresponding point is the last point in a figure and the figure should be closed:
Type | Meaning |
PT_CLOSEFIGURE | This flag specifies that the figure is automatically closed after the PT_LINETO or PT_BEZIERTO for this point is done. A line is to be drawn from this point to the previous PT_MOVETO point. |
This flag is combined with the PT_LINETO type for a line, or with the PT_BEZIERTO type of the end-point for a Bezier curve, using the bit-wise operator OR. |
nSize
Specifies the total number of POINTs that may be placed in the lpPoints array. This must be the same as the number of BYTEs that may be placed in lpTypes.
If nSize is zero, GetPath returns the total number of points in the path, and nothing is written to the buffers.
If nSize is non-zero, GetPath returns the number of points enumerated. If nSize is zero, it returns the total number of points in the path. The function returns -1 if nSize is not zero and is less than the number of points in the path.
The DC must have an inactive path bracket, started by calling BeginPath and ended by calling EndPath. GetPath does not affect the path.
The points of the path are returned in logical coordinates. Points are stored in the path in device coordinates, so GetPath transforms the points from device coordinates to logical coordinates using the inverse of the current transform.
FlattenPath may be called before GetPath so that only line segments will be enumerated.
Use the GetLastError function to retrieve the error value, which may be one of the following:
ERROR_INVALID_MODE ERROR_INVALID_PARAMETER ERROR_BUFFER_OVERFLOW |
FlattenPath, PolyDraw, WidenPath, POINT