gdiplus: Added GdipDrawImageRectRect.
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 5946fa3c..6be5de4 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1018,7 +1018,7 @@
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 @@
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 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);