diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index db227c1e15..538c571b29 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -79,7 +79,7 @@ @ stub GdipCreateBitmapFromHICON @ stub GdipCreateBitmapFromResource @ stdcall GdipCreateBitmapFromScan0(long long long long ptr ptr) -@ stub GdipCreateBitmapFromStream +@ stdcall GdipCreateBitmapFromStream(ptr ptr) @ stdcall GdipCreateBitmapFromStreamICM(ptr ptr) @ stub GdipCreateCachedBitmap @ stdcall GdipCreateCustomLineCap(ptr ptr long long ptr) @@ -437,7 +437,7 @@ @ stub GdipIsVisibleRegionRectI @ stub GdipLoadImageFromFile @ stub GdipLoadImageFromFileICM -@ stub GdipLoadImageFromStream +@ stdcall GdipLoadImageFromStream(ptr ptr) @ stdcall GdipLoadImageFromStreamICM(ptr ptr) @ stub GdipMeasureCharacterRanges @ stub GdipMeasureDriverString diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index d649e03ddb..391a5fc457 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -149,6 +149,24 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, 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, GpBitmap **bitmap) { @@ -344,8 +362,7 @@ GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, return NotImplemented; } -/* FIXME: no ICM */ -GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image) +GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image) { if(!stream || !image) return InvalidParameter; @@ -360,12 +377,18 @@ GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image) return GenericError; } - /* FIXME: use IPicture_get_Type to get image type */ + /* FIXME: use IPicture_get_Type to get image type? */ (*image)->type = ImageTypeUnknown; return Ok; } +/* FIXME: no ICM */ +GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image) +{ + return GdipLoadImageFromStream(stream, image); +} + GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage *image, PROPID propId) { static int calls; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index fb15b883c4..f735f940c4 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -166,6 +166,7 @@ GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*); GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap*,INT,INT,ARGB*); GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*, GpBitmap**); +GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream*,GpBitmap**); GpStatus WINGDIPAPI GdipDisposeImage(GpImage*); GpStatus WINGDIPAPI GdipGetImageBounds(GpImage*,GpRectF*,GpUnit*); @@ -178,6 +179,7 @@ GpStatus WINGDIPAPI GdipGetImageWidth(GpImage*,UINT*); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile*,MetafileHeader*); GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage*,PROPID,UINT*); GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*); +GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream*,GpImage**); GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream*,GpImage**); GpStatus WINGDIPAPI GdipRemovePropertyItem(GpImage*,PROPID); GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage*,IStream*,