Commit 484abd47 authored by Nathan Beckmann's avatar Nathan Beckmann Committed by Alexandre Julliard

gdiplus: Implement GdipLoadImageFromFile.

parent 3d802924
......@@ -435,7 +435,7 @@
@ stub GdipIsVisibleRegionPointI
@ stub GdipIsVisibleRegionRect
@ stub GdipIsVisibleRegionRectI
@ stub GdipLoadImageFromFile
@ stdcall GdipLoadImageFromFile(wstr ptr)
@ stub GdipLoadImageFromFileICM
@ stdcall GdipLoadImageFromStream(ptr ptr)
@ stdcall GdipLoadImageFromStreamICM(ptr ptr)
......
......@@ -697,6 +697,27 @@ GpStatus WINGDIPAPI GdipImageSelectActiveFrame(GpImage *image,
return Ok;
}
GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR* filename,
GpImage **image)
{
GpStatus stat;
IStream *stream;
if (!filename || !image)
return InvalidParameter;
stat = GdipCreateStreamOnFile(filename, GENERIC_READ, &stream);
if (stat != Ok)
return stat;
stat = GdipLoadImageFromStream(stream, image);
IStream_Release(stream);
return stat;
}
GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image)
{
IPicture *pic;
......
......@@ -114,6 +114,12 @@ static void test_LoadingImages(void)
stat = GdipCreateBitmapFromFile(0, (GpBitmap**)0xdeadbeef);
expect(InvalidParameter, stat);
stat = GdipLoadImageFromFile(0, 0);
expect(InvalidParameter, stat);
stat = GdipLoadImageFromFile(0, (GpImage**)0xdeadbeef);
expect(InvalidParameter, stat);
}
START_TEST(image)
......
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