Polyline

2.x

  BOOL Polyline(hdc, lppt, cPoints)    
  HDC hdc; /* handle of device context */
  const POINT FAR* lppt; /* address of array with points to connect */
  int cPoints; /* number of points in array */

The Polyline function draws a set of line segments, connecting the specified points. The lines are drawn from the first point through subsequent points, using the current pen. Unlike the LineTo function, the Polyline function neither uses nor updates the current position.

Parameters

hdc

Identifies the device context.

lppt

Points to an array of POINT structures. Each structure in the array specifies a point. The POINT structure has the following form:

typedef struct tagPOINT {   /* pt */
   int x;
   int y;
} POINT;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

cPoints

Specifies the number of points in the array. This value must be at least 2.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Example

The following example assigns values to an array of points and then calls the Polyline function:

HDC hdc;

POINT aPoints[3];

aPoints[0].x = 50;
aPoints[0].y = 10;
aPoints[1].x = 250;
aPoints[1].y = 50;
aPoints[2].x = 125;
aPoints[2].y = 130;

Polyline(hdc, aPoints, sizeof(aPoints) / sizeof(POINT));

See Also

LineTo, Polygon