gdiplus: Implementation of function GdipDrawEllipse.

This commit is contained in:
Przemysław Białek 2008-06-27 10:59:23 +02:00 committed by Alexandre Julliard
parent ce81d843c6
commit 864384e75d
2 changed files with 36 additions and 2 deletions

View File

@ -170,8 +170,8 @@
@ stdcall GdipDrawCurve(ptr ptr ptr long)
@ stdcall GdipDrawCurveI(ptr ptr ptr long)
@ stub GdipDrawDriverString
@ stub GdipDrawEllipse
@ stub GdipDrawEllipseI
@ stdcall GdipDrawEllipse(ptr ptr long long long long)
@ stdcall GdipDrawEllipseI(ptr ptr long long long long)
@ stdcall GdipDrawImage(ptr ptr long long)
@ stub GdipDrawImageFX
@ stdcall GdipDrawImageI(ptr ptr long long)

View File

@ -1106,6 +1106,40 @@ GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen,
return ret;
}
GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x,
REAL y, REAL width, REAL height)
{
INT save_state;
GpPointF ptf[2];
POINT pti[2];
if(!graphics || !pen)
return InvalidParameter;
ptf[0].X = x;
ptf[0].Y = y;
ptf[1].X = x + width;
ptf[1].Y = y + height;
save_state = prepare_dc(graphics, pen);
SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH));
transform_and_round_points(graphics, pti, ptf, 2);
Ellipse(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y);
restore_dc(graphics, save_state);
return Ok;
}
GpStatus WINGDIPAPI GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x,
INT y, INT width, INT height)
{
return GdipDrawEllipse(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
}
GpStatus WINGDIPAPI GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, REAL y)
{
/* IPicture::Render uses LONG coords */