Output(OS_WINDPOLYGON)


WORD Output(LPPDEVICE lpDestDev, WORD wStyle, WORD wCount, 
    LPPOINT lpPoints, LPPPEN lpPPen, LPPBRUSH lpPBrush, 
    LPDRAWMODE lpDrawMode, LPRECT lpClipRect);

Draws a polygon and fills it using the winding-number-filling method.

1

Function was successful.

0

Unrecoverable error occurred.

-1

Function does not support the specified style.


lpDestDev

Address of a PDEVICE or PBITMAP structure that specifies the destination device or bitmap.

wCount

The number of POINT structures in the array pointed to by the lpPoints parameter.

lpPoints

Address of an array of POINT structures that contains wCount elements. Each point represents a vertex of the polygon.

lpPPen

Address of a PPEN structure that specifies the physical pen that is used to draw the border of the polygon.

lpPBrush

Address of a PBRUSH structure that specifies the physical brush that is used to fill the polygon.

lpDrawMode

Address of a DRAWMODE structure that contains the drawing information that is used to draw and fill the polygon.

lpClipRect

Address of a RECT structure that contains coordinates for the clipping rectangle. If the lpClipRect parameter is NULL, the clipping rectangle is the entire display surface.

GDI calls Output with this style when an application calls functions, such as the Polygon function (GDI.36), and the current polygon-filling mode is WINDING.

The graphics driver must support the OS_WINDPOLYGON style if the PC_WINDPOLYGON value is set in the dpPolygonals member of the GDIINFO structure.

The Output function should fill the interior of the polygon first and then draw the border.

To fill the polygon, Output calculates the polygon outline and filling according to the winding-number-filling method. Winding-number filling depends on the direction (down or up) that each side of the polygon is drawn. With winding-number filling, a given closed area within a polygon should be filled if a horizontal ray, starting in the area and continuing through the left edge of the polygon, crosses an unequal number of upwardly and downwardly drawn sides.

To draw the border, Output draws a line segment from the first point in the array to the second, from the second to the third, and so on. If the last line segment does not end at the first point, Output draws this line segment to ensure a closed figure.

Although the Output function can use device hardware to draw and fill polygons, the function must either provide the same capability when drawing to a main memory bitmap or return -1 to direct GDI to simulate the output using polylines and scan lines.

See also Output(OS_ALTPOLYGON), Output(OS_POLYPOLYGON), PDEVICE, PBITMAP, DRAWMODE, RECT, POINT