gdiplus: Basic implementation of GdipImageGetFrameCount with updated tests.

oldstable
Justin Chevrier 2010-03-15 19:14:28 -04:00 committed by Alexandre Julliard
parent 94820ff0a4
commit 818420a378
2 changed files with 12 additions and 9 deletions

View File

@ -2196,6 +2196,7 @@ struct image_format_dimension image_format_dimensions[] =
{NULL}
};
/* FIXME: Need to handle multi-framed images */
GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image,
GDIPCONST GUID* dimensionID, UINT* count)
{
@ -2203,13 +2204,15 @@ GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image,
TRACE("(%p,%s,%p)\n", image, debugstr_guid(dimensionID), count);
if(!image || !dimensionID || !count)
if(!image || !count)
return InvalidParameter;
if(!(calls++))
FIXME("not implemented\n");
FIXME("returning frame count of 1\n");
return NotImplemented;
*count = 1;
return Ok;
}
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount(GpImage *image,

View File

@ -237,12 +237,12 @@ static void test_GdipImageGetFrameDimensionsCount(void)
}
stat = GdipImageGetFrameCount((GpImage*)bm, NULL, &count);
todo_wine expect(Ok, stat);
expect(Ok, stat);
count = 12345;
stat = GdipImageGetFrameCount((GpImage*)bm, &dimension, &count);
todo_wine expect(Ok, stat);
todo_wine expect(1, count);
expect(Ok, stat);
expect(1, count);
GdipBitmapSetPixel(bm, 0, 0, 0xffffffff);
@ -1601,7 +1601,7 @@ static void test_multiframegif(void)
count = 12345;
stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count);
todo_wine expect(Ok, stat);
expect(Ok, stat);
todo_wine expect(2, count);
/* SelectActiveFrame overwrites our current data */
@ -1675,8 +1675,8 @@ static void test_multiframegif(void)
count = 12345;
stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count);
todo_wine expect(Ok, stat);
todo_wine expect(1, count);
expect(Ok, stat);
expect(1, count);
GdipDisposeImage((GpImage*)bmp);
IStream_Release(stream);