gdiplus: Implement GdipImageGetFrameDimensionsList.
This commit is contained in:
parent
7d62e1f776
commit
d87b1d4980
|
@ -1708,6 +1708,19 @@ GpStatus WINGDIPAPI GdipGetPropertySize(GpImage *image, UINT* size, UINT* num)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct image_format_dimension
|
||||||
|
{
|
||||||
|
const GUID *format;
|
||||||
|
const GUID *dimension;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct image_format_dimension image_format_dimensions[] =
|
||||||
|
{
|
||||||
|
{&ImageFormatGIF, &FrameDimensionTime},
|
||||||
|
{&ImageFormatIcon, &FrameDimensionResolution},
|
||||||
|
{NULL}
|
||||||
|
};
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image,
|
GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image,
|
||||||
GDIPCONST GUID* dimensionID, UINT* count)
|
GDIPCONST GUID* dimensionID, UINT* count)
|
||||||
{
|
{
|
||||||
|
@ -1738,13 +1751,27 @@ GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount(GpImage *image,
|
||||||
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList(GpImage* image,
|
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList(GpImage* image,
|
||||||
GUID* dimensionIDs, UINT count)
|
GUID* dimensionIDs, UINT count)
|
||||||
{
|
{
|
||||||
static int calls;
|
int i;
|
||||||
|
const GUID *result=NULL;
|
||||||
|
|
||||||
if(!image || !dimensionIDs)
|
TRACE("(%p,%p,%u)\n", image, dimensionIDs, count);
|
||||||
|
|
||||||
|
if(!image || !dimensionIDs || count != 1)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
if(!(calls++))
|
for (i=0; image_format_dimensions[i].format; i++)
|
||||||
FIXME("not implemented\n");
|
{
|
||||||
|
if (IsEqualGUID(&image->format, image_format_dimensions[i].format))
|
||||||
|
{
|
||||||
|
result = image_format_dimensions[i].dimension;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!result)
|
||||||
|
result = &FrameDimensionPage;
|
||||||
|
|
||||||
|
memcpy(dimensionIDs, result, sizeof(GUID));
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,13 @@ static void test_GdipImageGetFrameDimensionsCount(void)
|
||||||
|
|
||||||
stat = GdipImageGetFrameDimensionsList((GpImage*)bm, &dimension, 1);
|
stat = GdipImageGetFrameDimensionsList((GpImage*)bm, &dimension, 1);
|
||||||
expect(Ok, stat);
|
expect(Ok, stat);
|
||||||
expect_guid(&FrameDimensionPage, &dimension, __LINE__, TRUE);
|
expect_guid(&FrameDimensionPage, &dimension, __LINE__, FALSE);
|
||||||
|
|
||||||
|
stat = GdipImageGetFrameDimensionsList((GpImage*)bm, &dimension, 2);
|
||||||
|
expect(InvalidParameter, stat);
|
||||||
|
|
||||||
|
stat = GdipImageGetFrameDimensionsList((GpImage*)bm, &dimension, 0);
|
||||||
|
expect(InvalidParameter, stat);
|
||||||
|
|
||||||
count = 12345;
|
count = 12345;
|
||||||
stat = GdipImageGetFrameCount((GpImage*)bm, &dimension, &count);
|
stat = GdipImageGetFrameCount((GpImage*)bm, &dimension, &count);
|
||||||
|
@ -1246,7 +1252,7 @@ static void test_multiframegif(void)
|
||||||
|
|
||||||
stat = GdipImageGetFrameDimensionsList((GpImage*)bmp, &dimension, 1);
|
stat = GdipImageGetFrameDimensionsList((GpImage*)bmp, &dimension, 1);
|
||||||
expect(Ok, stat);
|
expect(Ok, stat);
|
||||||
expect_guid(&FrameDimensionTime, &dimension, __LINE__, TRUE);
|
expect_guid(&FrameDimensionTime, &dimension, __LINE__, FALSE);
|
||||||
|
|
||||||
count = 12345;
|
count = 12345;
|
||||||
stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count);
|
stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count);
|
||||||
|
@ -1320,7 +1326,7 @@ static void test_multiframegif(void)
|
||||||
|
|
||||||
stat = GdipImageGetFrameDimensionsList((GpImage*)bmp, &dimension, 1);
|
stat = GdipImageGetFrameDimensionsList((GpImage*)bmp, &dimension, 1);
|
||||||
expect(Ok, stat);
|
expect(Ok, stat);
|
||||||
expect_guid(&FrameDimensionTime, &dimension, __LINE__, TRUE);
|
expect_guid(&FrameDimensionTime, &dimension, __LINE__, FALSE);
|
||||||
|
|
||||||
count = 12345;
|
count = 12345;
|
||||||
stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count);
|
stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count);
|
||||||
|
|
Loading…
Reference in New Issue