setpolyfillmode

The function is used to  set the current device polygon fill mode.

void setpolyfillmode(int mode);

Parameters

mode

Specify a polygon fill pattern, which can be the following value:

Value Description
ALTERNATE Alternate fill mode (the default).
In this mode, for each horizontal scan line, a pixel-by-pixel scan starts to fill when an odd number of edges of polygons are encountered, and when even edges are encountered, the population is stopped.
For example, a pentagram, where five edges intersect multiple times, the center pentagon is not filled when filled in ALTERNATE mode.
WINDING The mode filled according to the drawing direction.
In this mode, for each horizontal scan line, a pixel-by-pixel scan from left to right, starts filling when an odd number of edges of a polygon are encountered, and when an even number of edges are encountered, you need to further determine the direction of the edge that crosses the scan line: if the number of edges crossing the scan line from top to bottom is different and the number of edges crossing the scan line from the bottom up is different. If the number of edges is the same, the fill is stopped.
For example, a five-pointed star, where five edges intersect multiple times, is filled with the center pentagon when filled in WINDING mode.

Return Value

None

Remarks

This setting affects the execution of the three drawing polygon functions, fillpolygon, solidpolygon, and clearpolygon.

Examples

See the example of the solidpolygon function.