Commit 8128aeb0 authored by Evan Stade's avatar Evan Stade Committed by Alexandre Julliard

gdiplus: Added GdipCreateBitmapFromStream.

parent 81c0865b
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
@ stub GdipCreateBitmapFromHICON @ stub GdipCreateBitmapFromHICON
@ stub GdipCreateBitmapFromResource @ stub GdipCreateBitmapFromResource
@ stdcall GdipCreateBitmapFromScan0(long long long long ptr ptr) @ stdcall GdipCreateBitmapFromScan0(long long long long ptr ptr)
@ stub GdipCreateBitmapFromStream @ stdcall GdipCreateBitmapFromStream(ptr ptr)
@ stdcall GdipCreateBitmapFromStreamICM(ptr ptr) @ stdcall GdipCreateBitmapFromStreamICM(ptr ptr)
@ stub GdipCreateCachedBitmap @ stub GdipCreateCachedBitmap
@ stdcall GdipCreateCustomLineCap(ptr ptr long long ptr) @ stdcall GdipCreateCustomLineCap(ptr ptr long long ptr)
...@@ -437,7 +437,7 @@ ...@@ -437,7 +437,7 @@
@ stub GdipIsVisibleRegionRectI @ stub GdipIsVisibleRegionRectI
@ stub GdipLoadImageFromFile @ stub GdipLoadImageFromFile
@ stub GdipLoadImageFromFileICM @ stub GdipLoadImageFromFileICM
@ stub GdipLoadImageFromStream @ stdcall GdipLoadImageFromStream(ptr ptr)
@ stdcall GdipLoadImageFromStreamICM(ptr ptr) @ stdcall GdipLoadImageFromStreamICM(ptr ptr)
@ stub GdipMeasureCharacterRanges @ stub GdipMeasureCharacterRanges
@ stub GdipMeasureDriverString @ stub GdipMeasureDriverString
......
...@@ -149,6 +149,24 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, ...@@ -149,6 +149,24 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
return Ok; return Ok;
} }
GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream,
GpBitmap **bitmap)
{
GpStatus stat;
stat = GdipLoadImageFromStream(stream, (GpImage**) bitmap);
if(stat != Ok)
return stat;
/* FIXME: make sure it's actually a bitmap */
(*bitmap)->image.type = ImageTypeBitmap;
(*bitmap)->width = ipicture_pixel_width((*bitmap)->image.picture);
(*bitmap)->height = ipicture_pixel_height((*bitmap)->image.picture);
return Ok;
}
GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream* stream, GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream* stream,
GpBitmap **bitmap) GpBitmap **bitmap)
{ {
...@@ -344,8 +362,7 @@ GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, ...@@ -344,8 +362,7 @@ GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image,
return NotImplemented; return NotImplemented;
} }
/* FIXME: no ICM */ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image)
GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image)
{ {
if(!stream || !image) if(!stream || !image)
return InvalidParameter; return InvalidParameter;
...@@ -360,12 +377,18 @@ GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image) ...@@ -360,12 +377,18 @@ GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image)
return GenericError; return GenericError;
} }
/* FIXME: use IPicture_get_Type to get image type */ /* FIXME: use IPicture_get_Type to get image type? */
(*image)->type = ImageTypeUnknown; (*image)->type = ImageTypeUnknown;
return Ok; return Ok;
} }
/* FIXME: no ICM */
GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image)
{
return GdipLoadImageFromStream(stream, image);
}
GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage *image, PROPID propId) GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage *image, PROPID propId)
{ {
static int calls; static int calls;
......
...@@ -166,6 +166,7 @@ GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*); ...@@ -166,6 +166,7 @@ GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*);
GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap*,INT,INT,ARGB*); GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap*,INT,INT,ARGB*);
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*, GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*,
GpBitmap**); GpBitmap**);
GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream*,GpBitmap**);
GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream*,GpBitmap**);
GpStatus WINGDIPAPI GdipDisposeImage(GpImage*); GpStatus WINGDIPAPI GdipDisposeImage(GpImage*);
GpStatus WINGDIPAPI GdipGetImageBounds(GpImage*,GpRectF*,GpUnit*); GpStatus WINGDIPAPI GdipGetImageBounds(GpImage*,GpRectF*,GpUnit*);
...@@ -178,6 +179,7 @@ GpStatus WINGDIPAPI GdipGetImageWidth(GpImage*,UINT*); ...@@ -178,6 +179,7 @@ GpStatus WINGDIPAPI GdipGetImageWidth(GpImage*,UINT*);
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile*,MetafileHeader*); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile*,MetafileHeader*);
GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage*,PROPID,UINT*); GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage*,PROPID,UINT*);
GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*); GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*);
GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream*,GpImage**);
GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream*,GpImage**); GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream*,GpImage**);
GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage*,PROPID); GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage*,PROPID);
GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage*,IStream*, GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage*,IStream*,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment