|
Description
Converts
an enhanced-format metafile to a Microsoft® Windows® Metafile Format (WMF)
metafile and stores the converted records in a specified buffer.
Syntax
UINT WINGDIPAPI GdipEmfToWmfBits(
HENHMETAFILE hemf,
UINT cbData16,
LPBYTE pData16,
INT iMapMode,
INT eFlags
);
PowerBASIC
Syntax
DECLARE FUNCTION GdipEmfToWmfBits ( _
BYVAL hemf AS DWORD, _
BYVAL cbData16 AS DWORD, _
BYREF pData16 AS ANY, _
BYVAL iMapMode AS LONG, _
BYVAL eFlags AS LONG _
) AS DWORD
Parameters
hemf
[in] Handle to the enhanced-format metafile that is to be converted.
cbData16
[in] Unsigned integer that specifies the number of bytes in the buffer
pointed to by the pData16 parameter.
pData16
[out] Pointer to a buffer that receives the converted records. If
pData16 is NULL, GdipEmfToWmfBits returns the number of bytes
required to store the converted metafile records.
iMapMode
[in] Specifies the mapping mode to use in the converted metafile. For a
list of possible mapping modes, see SetMapMode. The default value
is MM_ANISOTROPIC.
eFlags
[in] Element of the EmfToWmfBitsFlags enumeration that specifies
options for the conversion. The default value is
EmfToWmfBitsFlagsDefault.
Return
Value
If the
function succeeds and the buffer pointer is NULL, the return value is the
number of bytes required to store the converted records. If the function
succeeds and the buffer pointer is a valid pointer, the return value is
the size of the metafile data in bytes. If the function fails, the return
value is zero.
Remarks
When you
call GdipEmfToWmfBits to determine the size of the required buffer,
you must pass the same value for eFlags that you pass later when
you call GdipEmfToWmfBits to perform the conversion. Otherwise, the
size returned by the first call to GdipEmfToWmfBits will be incorrect.
This
function cannot convert metafiles of type EmfTypeEmfPlusOnly. If
you use this function to convert a metafile of type EmfTypeEmfPlusDual,
the Enhanced Metafile (EMF) records in that metafile are converted, but
the EMF+ records are not converted.
This
function converts an enhanced metafile into a WMF metafile so that its
picture can be displayed in an application that recognizes the older
format.
The
GdipEmfToWmfBits function does not invalidate the enhanced metafile
handle. Call the DeleteEnhMetaFile function to release the handle
when it is no longer needed.
To
create a scalable WMF metafile, specify MM_ANISOTROPIC as the iMapMode
parameter.
|