Evan Stade : gdiplus: Added partial implementation of GdipSaveImageToStream .

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


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

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

gdiplus: Added partial implementation of GdipSaveImageToStream.

---

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/image.c      |   13 ++++++++++
 include/Makefile.in       |    1 +
 include/gdiplus.h         |    2 +
 include/gdiplusflat.h     |    2 +
 include/gdiplusimaging.h  |   56 +++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 75 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 26f7dd0..4a09aac 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -495,7 +495,7 @@
 @ stub GdipSaveAddImage
 @ stdcall GdipSaveGraphics(ptr ptr)
 @ stub GdipSaveImageToFile
-@ stub GdipSaveImageToStream
+@ stdcall GdipSaveImageToStream(ptr ptr ptr)
 @ stub GdipScaleLineTransform
 @ stdcall GdipScaleMatrix(ptr long long long)
 @ stub GdipScalePathGradientTransform
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index 0a164bb..28d4862 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -273,3 +273,16 @@ GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image)
 
     return Ok;
 }
+
+GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream* stream,
+    GDIPCONST CLSID* clsid, GDIPCONST EncoderParameters* params)
+{
+    if(!image || !stream)
+        return InvalidParameter;
+
+    /* FIXME: CLSID, EncoderParameters not used */
+
+    IPicture_SaveAsFile(image->picture, stream, FALSE, NULL);
+
+    return Ok;
+}
diff --git a/include/Makefile.in b/include/Makefile.in
index a79ae12..05dc60e 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -167,6 +167,7 @@ SRCDIR_INCLUDES = \
 	gdiplusenums.h \
 	gdiplusflat.h \
 	gdiplusgpstubs.h \
+	gdiplusimaging.h \
 	gdiplusinit.h \
 	gdiplusmem.h \
 	gdiplusmetaheader.h \
diff --git a/include/gdiplus.h b/include/gdiplus.h
index 6b42093..1f4ae78 100644
--- a/include/gdiplus.h
+++ b/include/gdiplus.h
@@ -33,6 +33,7 @@ namespace Gdiplus
 #include "gdiplusinit.h"
 #include "gdipluspixelformats.h"
 #include "gdiplusmetaheader.h"
+#include "gdiplusimaging.h"
 #include "gdiplusgpstubs.h"
 
     namespace DllExports
@@ -50,6 +51,7 @@ namespace Gdiplus
 #include "gdiplusinit.h"
 #include "gdipluspixelformats.h"
 #include "gdiplusmetaheader.h"
+#include "gdiplusimaging.h"
 #include "gdiplusgpstubs.h"
 
 #include "gdiplusflat.h"
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 0fea604..809868b 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -152,6 +152,8 @@ GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile*,MetafileHeader
 GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage*,PROPID,UINT*);
 GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*);
 GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream*,GpImage**);
+GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage*,IStream*,
+    GDIPCONST CLSID*,GDIPCONST EncoderParameters*);
 
 GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes**);
 GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes*);
diff --git a/include/gdiplusimaging.h b/include/gdiplusimaging.h
new file mode 100644
index 0000000..c76aba5
--- /dev/null
+++ b/include/gdiplusimaging.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _GDIPLUSIMAGING_H
+#define _GDIPLUSIMAGING_H
+
+#ifdef __cplusplus
+class EncoderParameter
+{
+public:
+    GUID    Guid;
+    ULONG   NumberOfValues;
+    ULONG   Type;
+    VOID*   Value;
+};
+
+class EncoderParameters
+{
+public:
+    UINT Count;
+    EncoderParameter Parameter[1];
+};
+#else /* end of c++ typedefs */
+
+typedef struct EncoderParameter
+{
+    GUID Guid;
+    ULONG NumberOfValues;
+    ULONG Type;
+    VOID* Value;
+} EncoderParameter;
+
+typedef struct EncoderParameters
+{
+    UINT Count;
+    EncoderParameter Parameter[1];
+} EncoderParameters;
+
+#endif /* end of c typedefs */
+
+#endif /* _GDIPLUSIMAGING_H */




More information about the wine-cvs mailing list