Declare Function SetPolyFillMode Lib "gdi32.dll" (ByVal hdc As Long, ByVal nPolyFillMode As Long) As Long
Platforms: Win 32s, Win 95/98, Win NT
SetPolyFillMode sets the method used by a device to fill polygonal areas and shapes. The two modes differ only over complex overlapping polygons, where the edges of the polygon criss-cross each other inside the interior (see the example for an example of a complex overlapping polygon). The function returns 0 if an error occured, or exactly one of the polygon fill mode flags specifying the filling mode the device had previously been set to.
Example:
' Use the alternating fill mode to fill that five-pointed star that everyone
' knows so well. Alternating filling tells window Form1 not to fill in the pentagonal interior
' of the star. It's hard to describe, so just run the example!
Dim points(0 to 4) As POINT_TYPE ' points of the star
Dim retval As Long ' return value
' Load the coordinates of a somewhat distorted five-pointed "pentagram" star
' design into the array.
points(0).x = 200: points(0).y = 400 ' 1st point: (200,400)
points(1).x = 300: points(1).y = 200 ' 2nd point: (300,200)
points(2).x = 400: points(2).y = 400 ' 3rd point: (400,400)
points(3).x = 150: points(3).y = 300 ' 4th point: (150,300)
points(4).x = 450: points(4).y = 300 ' 5th point: (450,300)
' Draw the polygon using alternating fill mode
retval = SetPolyFillMode(Form1.hDC, ALTERNATE) ' set the fill mode
retval = Polygon(Form1.hDC, points(0), 5) ' draw the polygon
See Also: GetPolyFillMode
Category: Regions
Go back to the alphabetical Function listing.
Go back to the Reference section index.
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/s/setpolyfillmode.html