Evan Stade : gdiplus: Implemented GdipDrawRectangleI.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jun 13 06:14:01 CDT 2007


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

Author: Evan Stade <estade at gmail.com>
Date:   Tue Jun 12 10:51:20 2007 -0700

gdiplus: Implemented GdipDrawRectangleI.

---

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/graphics.c   |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 04b2b7b..142011f 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -184,7 +184,7 @@
 @ stub GdipDrawPolygon
 @ stub GdipDrawPolygonI
 @ stub GdipDrawRectangle
-@ stub GdipDrawRectangleI
+@ stdcall GdipDrawRectangleI(ptr ptr long long long long)
 @ stub GdipDrawRectangles
 @ stub GdipDrawRectanglesI
 @ stub GdipDrawString
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 5f97002..674bede 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -81,3 +81,35 @@ GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1,
 
     return Ok;
 }
+
+GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
+    INT y, INT width, INT height)
+{
+    LOGBRUSH lb;
+    HPEN hpen;
+    HGDIOBJ old_obj;
+
+    if(!pen || !graphics)
+        return InvalidParameter;
+
+    lb.lbStyle = BS_SOLID;
+    lb.lbColor = pen->color;
+    lb.lbHatch = 0;
+
+    hpen = ExtCreatePen(PS_GEOMETRIC | PS_ENDCAP_SQUARE, (INT) pen->width,
+        &lb, 0, NULL);
+
+    old_obj = SelectObject(graphics->hdc, hpen);
+
+    /* assume pen aligment centered */
+    MoveToEx(graphics->hdc, x, y, NULL);
+    LineTo(graphics->hdc, x+width, y);
+    LineTo(graphics->hdc, x+width, y+height);
+    LineTo(graphics->hdc, x, y+height);
+    LineTo(graphics->hdc, x, y);
+
+    SelectObject(graphics->hdc, old_obj);
+    DeleteObject(hpen);
+
+    return Ok;
+}




More information about the wine-cvs mailing list