Commit 9d6e0750 authored by Evan Stade's avatar Evan Stade Committed by Alexandre Julliard

gdiplus: Added GdipDrawRectangles.

parent 30fdcc76
......@@ -196,7 +196,7 @@
@ stub GdipDrawPolygonI
@ stub GdipDrawRectangle
@ stdcall GdipDrawRectangleI(ptr ptr long long long long)
@ stub GdipDrawRectangles
@ stdcall GdipDrawRectangles(ptr ptr ptr long)
@ stub GdipDrawRectanglesI
@ stub GdipDrawString
@ stub GdipEmfToWmfBits
......
......@@ -1228,6 +1228,48 @@ GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
return Ok;
}
GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen,
GpRectF* rects, INT count)
{
GpPointF *ptf;
POINT *pti;
INT save_state, i;
if(!graphics || !pen || !rects || count < 1)
return InvalidParameter;
ptf = GdipAlloc(4 * count * sizeof(GpPointF));
pti = GdipAlloc(4 * count * sizeof(POINT));
if(!ptf || !pti){
GdipFree(ptf);
GdipFree(pti);
return OutOfMemory;
}
for(i = 0; i < count; i++){
ptf[4 * i + 3].X = ptf[4 * i].X = rects[i].X;
ptf[4 * i + 1].Y = ptf[4 * i].Y = rects[i].Y;
ptf[4 * i + 2].X = ptf[4 * i + 1].X = rects[i].X + rects[i].Width;
ptf[4 * i + 3].Y = ptf[4 * i + 2].Y = rects[i].Y + rects[i].Height;
}
save_state = prepare_dc(graphics, pen);
SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH));
transform_and_round_points(graphics, pti, ptf, 4 * count);
for(i = 0; i < count; i++)
Polygon(graphics->hdc, &pti[4 * i], 4);
restore_dc(graphics, save_state);
GdipFree(ptf);
GdipFree(pti);
return Ok;
}
GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
{
INT save_state;
......
......@@ -75,6 +75,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 GdipDrawRectangles(GpGraphics*,GpPen*,GpRectF*,INT);
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,
......
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