From f6f04f6e0ede8f7add6db6874a2c294fc993e900 Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Thu, 21 Jun 2007 16:15:13 -0700 Subject: [PATCH] gdiplus: Implemented GdipDrawLines. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 21 +++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 775bde391df..db9dd467d85 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -176,7 +176,7 @@ @ stub GdipDrawImageRectRectI @ stub GdipDrawLine @ stdcall GdipDrawLineI(ptr ptr long long long long) -@ stub GdipDrawLines +@ stdcall GdipDrawLines(ptr ptr ptr long) @ stub GdipDrawLinesI @ stub GdipDrawPath @ stdcall GdipDrawPie(ptr ptr long long long long long long) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index f917b6579ac..beba70073b9 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -259,6 +259,27 @@ GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1, return Ok; } +GpStatus WINGDIPAPI GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST + GpPointF *points, INT count) +{ + HGDIOBJ old_obj; + INT i; + + if(!pen || !graphics || (count < 2)) + return InvalidParameter; + + old_obj = SelectObject(graphics->hdc, pen->gdipen); + MoveToEx(graphics->hdc, roundr(points[0].X), roundr(points[0].Y), NULL); + + for(i = 1; i < count; i++){ + LineTo(graphics->hdc, roundr(points[i].X), roundr(points[i].Y)); + } + + SelectObject(graphics->hdc, old_obj); + + return Ok; +} + GpStatus WINGDIPAPI GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index e5c46b30597..93905fd580e 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -38,6 +38,7 @@ GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL, REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT,REAL); GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics*,GpPen*,INT,INT,INT,INT); +GpStatus WINGDIPAPI GdipDrawLines(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipDrawPie(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics*,GpPen*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipFillPie(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL,REAL,REAL);