gdiplus: Add support for reading nested metafiles.

Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Vincent Povirk 2019-02-22 10:59:32 -06:00 committed by Alexandre Julliard
parent b3c5b7da94
commit e2f37558a7
1 changed files with 33 additions and 0 deletions

View File

@ -1817,6 +1817,39 @@ static GpStatus metafile_deserialize_image(const BYTE *record_data, UINT data_si
} }
break; break;
} }
case ImageDataTypeMetafile:
{
EmfPlusMetafile *metafiledata = &data->ImageData.metafile;
if (data_size <= FIELD_OFFSET(EmfPlusMetafile, MetafileData))
return InvalidParameter;
data_size -= FIELD_OFFSET(EmfPlusMetafile, MetafileData);
switch (metafiledata->Type) {
case MetafileTypeEmf:
case MetafileTypeEmfPlusOnly:
case MetafileTypeEmfPlusDual:
{
HENHMETAFILE hemf;
hemf = SetEnhMetaFileBits(data_size, metafiledata->MetafileData);
if (!hemf)
return GenericError;
status = GdipCreateMetafileFromEmf(hemf, TRUE, (GpMetafile**)image);
if (status != Ok)
DeleteEnhMetaFile(hemf);
break;
}
default:
FIXME("metafile type %d not supported.\n", metafiledata->Type);
return NotImplemented;
}
break;
}
default: default:
FIXME("image type %d not supported.\n", data->Type); FIXME("image type %d not supported.\n", data->Type);
return NotImplemented; return NotImplemented;