Metafile::ConvertToEmfPlus(constGraphics*,constWCHAR*,INT*,EmfType,constWCHAR*) method (gdiplusheaders.h)

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

Syntax

Status ConvertToEmfPlus(
  [in] const Graphics *refGraphics,
  [in] const WCHAR    *filename,
       INT            *conversionFailureFlag,
  [in] EmfType        emfType,
  [in] const WCHAR    *description
);

Parameters

[in] 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.

[in] filename

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.

conversionFailureFlag

TBD

[in] 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.

[in] 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: Status

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

If the method fails, it returns one of the other elements of the Status 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

Requirement Value
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