Evan Stade : gdiplus: Added GdipFillRectangle.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Aug 9 08:23:14 CDT 2007


Module: wine
Branch: master
Commit: b66c0a00d9e334c8f732b438978829ab4c550576
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b66c0a00d9e334c8f732b438978829ab4c550576

Author: Evan Stade <estade at gmail.com>
Date:   Wed Aug  8 19:42:10 2007 -0700

gdiplus: Added GdipFillRectangle.

---

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/graphics.c   |   33 +++++++++++++++++++++++++++++++++
 include/gdiplusflat.h     |    1 +
 3 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 0da04b0..f0d1bde 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -226,7 +226,7 @@
 @ stub GdipFillPolygon2I
 @ stdcall GdipFillPolygon(ptr ptr ptr long long)
 @ stdcall GdipFillPolygonI(ptr ptr ptr long long)
-@ stub GdipFillRectangle
+@ stdcall GdipFillRectangle(ptr ptr long long long long)
 @ stdcall GdipFillRectangleI(ptr ptr long long long long)
 @ stub GdipFillRectangles
 @ stub GdipFillRectanglesI
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index f282519..5946fa3 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1336,6 +1336,39 @@ end:
     return retval;
 }
 
+GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics *graphics, GpBrush *brush,
+    REAL x, REAL y, REAL width, REAL height)
+{
+    INT save_state;
+    GpPointF ptf[4];
+    POINT pti[4];
+
+    if(!graphics || !brush)
+        return InvalidParameter;
+
+    ptf[0].X = x;
+    ptf[0].Y = y;
+    ptf[1].X = x + width;
+    ptf[1].Y = y;
+    ptf[2].X = x + width;
+    ptf[2].Y = y + height;
+    ptf[3].X = x;
+    ptf[3].Y = y + height;
+
+    save_state = SaveDC(graphics->hdc);
+    EndPath(graphics->hdc);
+    SelectObject(graphics->hdc, brush->gdibrush);
+    SelectObject(graphics->hdc, GetStockObject(NULL_PEN));
+
+    transform_and_round_points(graphics, pti, ptf, 4);
+
+    Polygon(graphics->hdc, pti, 4);
+
+    RestoreDC(graphics->hdc, save_state);
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush,
     INT x, INT y, INT width, INT height)
 {
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 2a0a28e..1ae9ced 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -76,6 +76,7 @@ GpStatus WINGDIPAPI GdipFillPath(GpGraphics*,GpBrush*,GpPath*);
 GpStatus WINGDIPAPI GdipFillPie(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics*,GpBrush*,GDIPCONST GpPoint*,INT,
     GpFillMode);
+GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics*,GpBrush*,INT,INT,INT,INT);
 GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*);
 GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics*,InterpolationMode*);




More information about the wine-cvs mailing list