The following example fills a path.
C++
VOID Example_FillPath(HDC hdc)
{
Graphics graphics(hdc);
// Create a GraphicsPath and add an ellipse.
GraphicsPath ellipsePath;
ellipsePath.AddEllipse(Rect(100, 50, 200, 100));
// Create a SolidBrush object.
SolidBrush blackBrush(Color(255, 0, 0, 0));
// Draw ellipsePath.
graphics.FillPath(&blackBrush, &ellipsePath);
}
PowerBASIC
SUB GDIP_FillPath (BYVAL hdc AS DWORD)
LOCAL hStatus AS LONG
LOCAL pGraphics AS DWORD
LOCAL pBrush AS DWORD
LOCAL pEllipsePath AS DWORD
hStatus = GdipCreateFromHDC(hdc, pGraphics)
' Create a GraphicsPath object, and add an ellipse
hStatus = GdipCreatePath(%FillModeAlternate, pEllipsePath)
hStatus = GdipAddPathEllipseI(pEllipsePath, 100, 50, 200, 100)
' // Create a SolidBrush
hStatus = GdipCreateSolidFill(GDIP_ARGB(255, 0, 0, 0), pBrush)
' // Fill ellipsePath.
hStatus = GdipFillPath(pGraphics, pBrush, pEllipsePath)
' // Cleanup
IF pBrush THEN GdipDeleteBrush(pBrush)
IF pEllipsePath THEN GdipDeletePath(pEllipsePath)
IF pGraphics THEN GdipDeleteGraphics(pGraphics)
END SUB
(http://www.jose.it-berater.org/captures/GdipFillPath.png)