clearpolygon

This function is used to clear a polygon region.

void clearpolygon(
	const POINT *points,
	int num
);

Parameters

points

The coordinates of each point, the number of array elements is num.
The function automatically connects the polygon to the end.

num

The number of polygon vertices.

Return Value

None

Remarks

The function uses the background color to clear the polygon region.

Examples

The following snippet clears a triangle area (two methods):

// method 1
POINT pts[] = { {50, 200}, {200, 200}, {200, 50} };
clearpolygon(pts, 3);
// method 2
int pts[] = {50, 200,  200, 200,  200, 50};
clearpolygon((POINT*)pts, 3);
(贡献者:Krissi  编辑