gdiplus: Added GdipCreateBitmapFromFile.

This commit is contained in:
Evan Stade 2007-08-07 18:42:04 -07:00 committed by Alexandre Julliard
parent 3ea77f5cfd
commit 8726f5ad2d
3 changed files with 24 additions and 1 deletions

View File

@ -71,7 +71,7 @@
@ stub GdipConvertToEmfPlusToStream
@ stub GdipCreateAdjustableArrowCap
@ stub GdipCreateBitmapFromDirectDrawSurface
@ stub GdipCreateBitmapFromFile
@ stdcall GdipCreateBitmapFromFile(wstr ptr)
@ stub GdipCreateBitmapFromFileICM
@ stub GdipCreateBitmapFromGdiDib
@ stub GdipCreateBitmapFromGraphics

View File

@ -229,6 +229,28 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
return Ok;
}
GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename,
GpBitmap **bitmap)
{
GpStatus stat;
IStream *stream;
if(!filename || !bitmap)
return InvalidParameter;
stat = GdipCreateStreamOnFile(filename, GENERIC_READ, &stream);
if(stat != Ok)
return stat;
stat = GdipCreateBitmapFromStream(stream, bitmap);
if(!stat)
IStream_Release(stream);
return stat;
}
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
PixelFormat format, BYTE* scan0, GpBitmap** bitmap)
{

View File

@ -167,6 +167,7 @@ GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*);
GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap*,INT,INT,ARGB*);
GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap*,GDIPCONST GpRect*,UINT,
PixelFormat,BitmapData*);
GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR*,GpBitmap**);
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*,
GpBitmap**);
GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream*,GpBitmap**);