Metafile::ConvertToEmfPlus method

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

Syntax

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

Parameters

refGraphics

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.

conversionFailureFlag

Type: BOOL*

Optional. Pointer to a BOOL that receives TRUE if all the metafile records were converted successfully; FALSE otherwise. Pass NULL if you do not want to receive this information. The default value is NULL.

emfType

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.

description

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="https://docs.microsoft.com/windows/desktop/api/gdiplustypes/ne-gdiplustypes-status">Status</a> enumeration.

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

					<a href="https://docs.microsoft.com/windows/desktop/api/gdiplustypes/ne-gdiplustypes-status">Status</a> enumeration.

Remarks

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.

Requirements

   
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