gdiplus: Implemented GdipDrawBeziers.

This commit is contained in:
Nikolay Sivov 2008-07-03 03:04:50 +04:00 committed by Alexandre Julliard
parent 1ee3b0fac6
commit d020474cb5
3 changed files with 52 additions and 2 deletions

View File

@ -156,8 +156,8 @@
@ stdcall GdipDrawArcI(ptr ptr long long long long long long)
@ stdcall GdipDrawBezier(ptr ptr long long long long long long long long)
@ stdcall GdipDrawBezierI(ptr ptr long long long long long long long long)
@ stub GdipDrawBeziers
@ stub GdipDrawBeziersI
@ stdcall GdipDrawBeziers(ptr ptr ptr long)
@ stdcall GdipDrawBeziersI(ptr ptr ptr long)
@ stub GdipDrawCachedBitmap
@ stub GdipDrawClosedCurve2
@ stub GdipDrawClosedCurve2I

View File

@ -997,6 +997,54 @@ GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1,
return retval;
}
GpStatus WINGDIPAPI GdipDrawBeziers(GpGraphics *graphics, GpPen *pen,
GDIPCONST GpPointF *points, INT count)
{
INT i;
GpStatus ret;
if(!graphics || !pen || !points || (count <= 0))
return InvalidParameter;
for(i = 0; i < floor(count / 4); i++){
ret = GdipDrawBezier(graphics, pen,
points[4*i].X, points[4*i].Y,
points[4*i + 1].X, points[4*i + 1].Y,
points[4*i + 2].X, points[4*i + 2].Y,
points[4*i + 3].X, points[4*i + 3].Y);
if(ret != Ok)
return ret;
}
return Ok;
}
GpStatus WINGDIPAPI GdipDrawBeziersI(GpGraphics *graphics, GpPen *pen,
GDIPCONST GpPoint *points, INT count)
{
GpPointF *pts;
GpStatus ret;
INT i;
if(!graphics || !pen || !points || (count <= 0))
return InvalidParameter;
pts = GdipAlloc(sizeof(GpPointF) * count);
if(!pts)
return OutOfMemory;
for(i = 0; i < count; i++){
pts[i].X = (REAL)points[i].X;
pts[i].Y = (REAL)points[i].Y;
}
ret = GdipDrawBeziers(graphics,pen,pts,count);
GdipFree(pts);
return ret;
}
GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics *graphics, GpPen *pen,
GDIPCONST GpPointF *points, INT count)
{

View File

@ -78,6 +78,8 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL
GpStatus WINGDIPAPI GdipDrawArcI(GpGraphics*,GpPen*,INT,INT,INT,INT,REAL,REAL);
GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL,REAL,REAL);
GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics*,GpPen*,INT,INT,INT,INT,INT,INT,INT,INT);
GpStatus WINGDIPAPI GdipDrawBeziers(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT);
GpStatus WINGDIPAPI GdipDrawBeziersI(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT);
GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT);
GpStatus WINGDIPAPI GdipDrawCurveI(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT);
GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT,REAL);