Evan Stade : gdiplus: Added GdipDrawImageI.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Aug 8 08:59:47 CDT 2007
Module: wine
Branch: master
Commit: de351ab9917778b95ff38c457e006efccaefe234
URL: http://source.winehq.org/git/wine.git/?a=commit;h=de351ab9917778b95ff38c457e006efccaefe234
Author: Evan Stade <estade at gmail.com>
Date: Tue Aug 7 18:42:12 2007 -0700
gdiplus: Added GdipDrawImageI.
---
dlls/gdiplus/gdiplus.spec | 2 +-
dlls/gdiplus/graphics.c | 27 +++++++++++++++++++++++++++
include/gdiplusflat.h | 1 +
3 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index c49a395..b188170 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -174,7 +174,7 @@
@ stub GdipDrawEllipseI
@ stub GdipDrawImage
@ stub GdipDrawImageFX
-@ stub GdipDrawImageI
+@ stdcall GdipDrawImageI(ptr ptr long long)
@ stub GdipDrawImagePointRect
@ stub GdipDrawImagePointRectI
@ stub GdipDrawImagePoints
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 57ad025..8d31661 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -989,6 +989,33 @@ GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen,
return retval;
}
+GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x,
+ INT y)
+{
+ UINT width, height, srcw, srch;
+
+ if(!graphics || !image)
+ return InvalidParameter;
+
+ GdipGetImageWidth(image, &width);
+ GdipGetImageHeight(image, &height);
+
+ srcw = width * (((REAL) INCH_HIMETRIC) /
+ ((REAL) GetDeviceCaps(graphics->hdc, LOGPIXELSX)));
+ srch = height * (((REAL) INCH_HIMETRIC) /
+ ((REAL) GetDeviceCaps(graphics->hdc, LOGPIXELSY)));
+
+ if(image->type != ImageTypeMetafile){
+ y += height;
+ height *= -1;
+ }
+
+ IPicture_Render(image->picture, graphics->hdc, x, y, width, height,
+ 0, 0, srcw, srch, NULL);
+
+ return Ok;
+}
+
/* FIXME: partially implemented */
GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image,
GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth,
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index aba71ed..08f0696 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -58,6 +58,7 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL
GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,
REAL,REAL,REAL);
GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT,REAL);
+GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics*,GpImage*,INT,INT);
GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics*,GpImage*,
GDIPCONST GpPointF*,INT,REAL,REAL,REAL,REAL,GpUnit,
GDIPCONST GpImageAttributes*,DrawImageAbort,VOID*);
More information about the wine-cvs
mailing list