Commit 4b9bfbe7 authored by Evan Stade's avatar Evan Stade Committed by Alexandre Julliard

gdiplus: Implemented GdipDrawRectangleI.

parent 2689b18e
......@@ -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
......
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment