gdiplus: Added partial implementation of GdipSaveImageToStream.

This commit is contained in:
Evan Stade 2007-07-31 19:16:00 -07:00 committed by Alexandre Julliard
parent 6394e315cf
commit 8304765abd
6 changed files with 75 additions and 1 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -167,6 +167,7 @@ SRCDIR_INCLUDES = \
gdiplusenums.h \
gdiplusflat.h \
gdiplusgpstubs.h \
gdiplusimaging.h \
gdiplusinit.h \
gdiplusmem.h \
gdiplusmetaheader.h \

View File

@ -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"

View File

@ -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*);

56
include/gdiplusimaging.h Normal file
View File

@ -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 */