From 4c5486fe923e138f34f258fff4f8c97c2bae90c5 Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Tue, 31 Jul 2007 19:15:48 -0700 Subject: [PATCH] gdiplus: Implemented GdipLoadImageFromStreamICM. --- dlls/gdiplus/brush.c | 3 +++ dlls/gdiplus/customlinecap.c | 2 ++ dlls/gdiplus/gdiplus.c | 2 ++ dlls/gdiplus/graphicspath.c | 3 +++ dlls/gdiplus/image.c | 21 ++++++++++++++++----- dlls/gdiplus/imageattributes.c | 2 ++ dlls/gdiplus/matrix.c | 2 ++ dlls/gdiplus/pathiterator.c | 2 ++ dlls/gdiplus/pen.c | 3 +++ include/gdiplusflat.h | 1 + 10 files changed, 36 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 76456bd784d..ce01ccb6fed 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -18,6 +18,9 @@ #include "windef.h" #include "wingdi.h" + +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c index eb851c9b907..417a74004e5 100644 --- a/dlls/gdiplus/customlinecap.c +++ b/dlls/gdiplus/customlinecap.c @@ -22,6 +22,8 @@ #include "winbase.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 041d6feb33f..edbfb1cb2c6 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -25,6 +25,8 @@ #include "wine/debug.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 4fe99e071c2..ea524080686 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -24,6 +24,9 @@ #include "winbase.h" #include "winuser.h" #include "wingdi.h" + +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index ba5a23e859e..00d0a581a17 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -20,10 +20,12 @@ #include "windef.h" #include "winbase.h" +#include "winuser.h" #include "wingdi.h" #define COBJMACROS #include "objbase.h" +#include "olectl.h" #include "gdiplus.h" #include "gdiplus_private.h" @@ -172,15 +174,24 @@ GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, return NotImplemented; } +/* FIXME: no ICM */ GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image) { - static int calls; - if(!stream || !image) return InvalidParameter; - if(!(calls++)) - FIXME("not implemented\n"); + *image = GdipAlloc(sizeof(GpImage)); + if(!*image) return OutOfMemory; - return NotImplemented; + if(OleLoadPicture(stream, 0, FALSE, &IID_IPicture, + (LPVOID*) &((*image)->picture)) != S_OK){ + TRACE("Could not load picture\n"); + GdipFree(*image); + return GenericError; + } + + /* FIXME: use IPicture_get_Type to get image type */ + (*image)->type = ImageTypeUnknown; + + return Ok; } diff --git a/dlls/gdiplus/imageattributes.c b/dlls/gdiplus/imageattributes.c index 7c367809217..29b85493d4e 100644 --- a/dlls/gdiplus/imageattributes.c +++ b/dlls/gdiplus/imageattributes.c @@ -19,6 +19,8 @@ #include "windef.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index 1c4738e15f8..e6be4184bdb 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -23,6 +23,8 @@ #include "winbase.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/pathiterator.c b/dlls/gdiplus/pathiterator.c index b978c26833b..d1e4e88bf97 100644 --- a/dlls/gdiplus/pathiterator.c +++ b/dlls/gdiplus/pathiterator.c @@ -22,6 +22,8 @@ #include "winbase.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index b85f158ecf2..f121380b2db 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -21,6 +21,9 @@ #include "windef.h" #include "winbase.h" #include "wingdi.h" + +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 4906160831e..348d7c033c6 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -148,6 +148,7 @@ GpStatus WINGDIPAPI GdipGetImageVerticalResolution(GpImage*,REAL*); GpStatus WINGDIPAPI GdipGetImageWidth(GpImage*,UINT*); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile*,MetafileHeader*); GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*); +GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream*,GpImage**); GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes**); GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes*);