Module: wine Branch: master Commit: 04d4c2621cb31b6d844c021fde10bcdad30c1a06 URL: http://source.winehq.org/git/wine.git/?a=commit;h=04d4c2621cb31b6d844c021fde...
Author: Evan Stade estade@gmail.com Date: Thu Aug 9 18:25:09 2007 -0700
gdiplus: Added GdipDrawImageRectRect.
---
dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 21 ++++++++++++++++++++- include/gdiplusflat.h | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index b09ca8e..9296354 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -183,7 +183,7 @@ @ stub GdipDrawImagePointsRectI @ stub GdipDrawImageRect @ stub GdipDrawImageRectI -@ stub GdipDrawImageRectRect +@ stdcall GdipDrawImageRectRect(ptr ptr long long long long long long long long long ptr long ptr) @ stub GdipDrawImageRectRectI @ stdcall GdipDrawLine(ptr ptr long long long long) @ stdcall GdipDrawLineI(ptr ptr long long long long) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 5946fa3..6be5de4 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1018,7 +1018,7 @@ GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x, return Ok; }
-/* FIXME: partially implemented */ +/* FIXME: partially implemented (only works for rectangular parallelograms) */ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes, @@ -1071,6 +1071,25 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image return Ok; }
+GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image, + REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy, + REAL srcwidth, REAL srcheight, GpUnit srcUnit, + GDIPCONST GpImageAttributes* imageattr, DrawImageAbort callback, + VOID * callbackData) +{ + GpPointF points[3]; + + points[0].X = dstx; + points[0].Y = dsty; + points[1].X = dstx + dstwidth; + points[1].Y = dsty; + points[2].X = dstx; + points[2].Y = dsty + dstheight; + + return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy, + srcwidth, srcheight, srcUnit, imageattr, callback, callbackData); +} + GpStatus WINGDIPAPI GdipDrawLine(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index b190492..2060e28 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -66,6 +66,9 @@ GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics*,GpImage*,INT,INT); GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics*,GpImage*, GDIPCONST GpPointF*,INT,REAL,REAL,REAL,REAL,GpUnit, GDIPCONST GpImageAttributes*,DrawImageAbort,VOID*); +GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics*,GpImage*,REAL,REAL,REAL, + REAL,REAL,REAL,REAL,REAL,GpUnit,GDIPCONST GpImageAttributes*,DrawImageAbort, + VOID*); GpStatus WINGDIPAPI GdipDrawLine(GpGraphics *graphics,GpPen*,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics*,GpPen*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipDrawLines(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT);