Evan Stade : gdiplus: Implemented GdipLoadImageFromStreamICM.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 1 05:16:52 CDT 2007


Module: wine
Branch: master
Commit: 4c5486fe923e138f34f258fff4f8c97c2bae90c5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4c5486fe923e138f34f258fff4f8c97c2bae90c5

Author: Evan Stade <estade at gmail.com>
Date:   Tue Jul 31 19:15:48 2007 -0700

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 76456bd..ce01ccb 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 eb851c9..417a740 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 041d6fe..edbfb1c 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 4fe99e0..ea52408 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 ba5a23e..00d0a58 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 7c36780..29b8549 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 1c4738e..e6be418 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 b978c26..d1e4e88 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 b85f158..f121380 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 4906160..348d7c0 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*);




More information about the wine-cvs mailing list