FillMode Enum
The FillMode enumeration specifies how the interior of a shape is determined when it is filled. It is used by GDI+ graphics objects such as GraphicsPath and Region.
Members
| Name | Value | Description |
|---|---|---|
| Alternate | 0 | Specifies an alternating parity fill mode. The interior of the shape is determined by drawing a line from the point to infinity and counting the number of times a path segment crosses the line. If the count is odd, the point is inside; if even, it\'s outside. |
| Winding | 1 | Specifies a winding fill mode. The interior of the shape is determined by drawing a line from the point to infinity and summing the winding numbers of the path segments. Non‑zero sum indicates the point is inside. |
Usage Example (C++)
#include <gdiplus.h>
using namespace Gdiplus;
int main() {
GdiplusStartupInput gdiStartupInput;
ULONG_PTR token;
GdiplusStartup(&token, &gdiStartupInput, nullptr);
Graphics graphics(GetDC(NULL));
GraphicsPath path;
path.AddEllipse(50, 50, 200, 100);
path.AddRectangle(Rect(100, 80, 150, 100));
path.SetFillMode(FillModeWinding); // or FillModeAlternate
SolidBrush brush(Color(255, 0, 128, 255));
graphics.FillPath(&brush, &path);
GdiplusShutdown(token);
return 0;
}