Output(OS_ALTPOLYGON)

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

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

1 Function was successful.
0 Unrecoverable error occurred.
-1 Function does not support specified style.

lpDestDev
Address of a PDEVICE or PBITMAP structure that specifies the destination device or bitmap.
wStyle
Must be OS_ALTPOLYGON.
wCount
Count of POINT structures in the array pointed to by lpPoints.
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 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.

Output fills the interior of the polygon first, then draws the border.

To fill the polygon, Output calculates the polygon outline and fills it according to the alternate-filling method. Alternate filling typically fills every other closed area within a polygon. In general, a given area should be filled if a horizontal ray, starting in the area and continuing through the left edge of the polygon, crosses an odd number of polygon 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 Output can use device hardware to draw and fill polygons, the function either must provide the same capability when drawing to a main memory bitmap, or return a value of -1 to direct GDI to simulate the output using polylines and scan lines.

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 ALTERNATE.

The graphics driver can support the OS_ALTPOLYGON style if the PC_ALTPOLYGON bit is set in the dpPolygonals member of the GDIINFO structure.

See Also

Output(OS_POLYPOLYGON), Output(OS_WINDPOLYGON), PDEVICE, PBITMAP, DRAWMODE, RECT, POINT