Metafile::ConvertToEmfPlus method

The Metafile::ConvertToEmfPlus method converts this Metafile object to the EMF+ format.


Status ConvertToEmfPlus(
  IN const Graphics *refGraphics,
  IN const WCHAR    *filename,
  IN OUT INT        *conversionFailureFlag,
  IN EmfType        emfType,
  IN const WCHAR    *description



Type: const Graphics*

Pointer to a Graphics object whose state (settings for antialiasing, interpolation, and the like) is applied to the records stored in the converted metafile.


Type: const WCHAR*

Pointer to a null-terminated wide-character string that specifies the name of a file to which the converted metafile is saved.




Type: EmfType

Optional. Element of the EmfType enumeration that specifies whether the converted file has the EmfTypeEmfPlusOnly format or the EmfTypeEmfPlusDual format. Do not pass EmfTypeEmfOnly. The default value is EmfTypeEmfPlusOnly.


Type: const WCHAR*

Optional. Pointer to a null-terminated wide-character string that is stored in the header of the converted metafile. The default value is NULL.

Return Value

Type: Type: Status

If the method succeeds, it returns OK, which is an element of the

					<a href="">Status</a> enumeration.

If the method fails, it returns one of the other elements of the

					<a href="">Status</a> enumeration.


This method replaces the records originally in the Metafile object with the converted records. To retain a copy of the original Metafile object, call the Clone method.

If you set the emfType parameter to EmfTypeEmfPlusDual, the converted metafile contains an Enhanced Metafile (EMF) representation and an EMF+ representation. The EMF representation is the original set of EMF records rather than EMF records converted back from the newly created EMF+ records.

It is possible for the return value to be Ok and the value returned in conversionSuccess to be FALSE. Sometimes the overall conversion is considered to be successful even if a few individual records failed to convert with complete accuracy. For example, the original metafile might have records or operations that are not supported by Windows GDI+ (or EMF+), in which case those records or operations are emulated.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header gdiplusheaders.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll