diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 3c6f140012d..b5e0b03dcf9 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -208,7 +208,7 @@ @ stub GdipFillClosedCurveI @ stub GdipFillEllipse @ stub GdipFillEllipseI -@ stub GdipFillPath +@ stdcall GdipFillPath(ptr ptr ptr) @ stdcall GdipFillPie(ptr ptr long long long long long long) @ stub GdipFillPieI @ stub GdipFillPolygon2 diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index d28d76a3852..6123b69299d 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -785,6 +785,38 @@ GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x, return Ok; } +GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path) +{ + INT save_state; + GpStatus retval; + + if(!brush || !graphics || !path) + return InvalidParameter; + + save_state = SaveDC(graphics->hdc); + EndPath(graphics->hdc); + SelectObject(graphics->hdc, brush->gdibrush); + SetPolyFillMode(graphics->hdc, (path->fill == FillModeAlternate ? ALTERNATE + : WINDING)); + + BeginPath(graphics->hdc); + retval = draw_poly(graphics->hdc, NULL, path->pathdata.Points, + path->pathdata.Types, path->pathdata.Count, FALSE); + + if(retval != Ok) + goto end; + + EndPath(graphics->hdc); + FillPath(graphics->hdc); + + retval = Ok; + +end: + RestoreDC(graphics->hdc, save_state); + + return retval; +} + GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 7f2113d7a99..3bda290e4ae 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -44,6 +44,7 @@ GpStatus WINGDIPAPI GdipDrawLines(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipDrawPath(GpGraphics*,GpPen*,GpPath*); GpStatus WINGDIPAPI GdipDrawPie(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics*,GpPen*,INT,INT,INT,INT); +GpStatus WINGDIPAPI GdipFillPath(GpGraphics*,GpBrush*,GpPath*); GpStatus WINGDIPAPI GdipFillPie(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*); GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics*,InterpolationMode*);