unsigned get_win_metafile_bits(handle metafile,
                               unsigned size,
                               byte* buffer,
                               int mode,
                               handle Reference)

This function converts enhanced format records to windows format records.


handle metafile

The handle of the metafile containing the enhanced format records.

unsigned size

The size (in bytes) of the buffer pointed to by the parameter buffer.

byte* buffer

A pointer to a buffer to hold the metafile data. If null is specified, the required buffer size is returned.

int mode

The mapping mode used to perform the conversion.

handle reference

The handle of the reference device context.



Zero The call failed.
Other Either the required buffer size (if the input buffer was null) or the number of bytes transferred to the buffer (if a valid buffer pointer was given).


The reference device context is used to determine the resolution of the converted metafile.

Due to the limitations of the windows format metafile, some information may be lost in the retrieved metafile contents. For example, Bezier splines may be converted to multiple lines because splines are not supported in the older windows format.

To create a scalable, windows format metafile, the mapping mode should be set to unit::anisotropic.

The upper-left corner of the metafile picture is always mapped to the origin of the reference device.