CreatePolyPolygonRgn

Version 3.0

Syntax

HRGN CreatePolyPolygonRgn(lpPoints,lpPolyCounts,nCount,nPolyFillMode)

This function creates a region consisting of a series of closed polygons. The region is filled using the mode specified by the nPolyFillMode parameter. The polygons may overlap, but they do not have to overlap.

Parameter Type/Description  
lpPoints LPPOINT Points to an array of POINT data structures that define the vertices of the polygons. Each polygon must be a closed polygon. The polygons are not automatically closed. The polygons are specified consecutively.  
lpPolyCounts LPINT Points to an array of integers, each of which specifies the number of points in one of the polygons in the lpPoints array.  
nCount int Specifies the total number of integers in the lpPolyCounts array.  
nPolyFillMode int Specifies the filling mode for the region. The nPolyFillMode parameter may be either of the following values:  
  Value Meaning
  ALTERNATE Selects alternate mode.
  WINDING Selects winding number mode.

Return Value

The return value identifies the region if the function was successfull. Otherwise, it is NULL.

Comments

In general, the polygon fill modes differ only in cases where a complex, overlapping polygon must be filled (for example, a five-sided polygon that forms a five-pointed star with a pentagon in the center). In such cases, ALTERNATE mode fills every other enclosed region within the polygon (that is, the points of the star), but WINDING mode fills all regions (that is, the points and the pentagon).

When the filling mode is ALTERNATE, GDI fills the area between odd-numbered and even-numbered polygon sides on each scan line. That is, GDI fills the area between the first and second side, between the third and fourth side, and so on.

To fill all parts of the region, WINDING mode causes GDI to compute and draw a border that encloses the region but does not overlap. For example, in WINDING mode, the five-sided polygon that forms the star is computed as a ten-sided polygon with no overlapping sides; the resulting star is filled.