Converts a Windows metafile (WMF) into a LEAD Technologies vector handle. When this function is completed, there are two copies of the drawing in memory: the WMF and the original LEAD vector. Freeing one will not affect the other. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecConvertFromWMF(hDC, pVector, hWMF)
Handle to the device context responsible for the conversion.
Pointer to the vector handle to be updated with the converted file.
Handle to the WMF to be converted.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function updates information in the vector handle and copies the WMF drawing data into the LEAD bitmap.
This example converts a windows metafile into a DXF file.
L_LTVKRNTEX_API L_INT VecConvertFromWMFExample(
HWND hWnd,
L_TCHAR* pszFileName,
HMETAFILE hWMF)
{
L_INT nRet;
VECTORHANDLE TmpVector; /* Vector handle for initial conversion */
HDC hDC;
/* Convert to LEAD vector */
hDC = GetDC( hWnd );
nRet = L_VecConvertFromWMF(hDC, &TmpVector, hWMF );
if(nRet != SUCCESS)
return nRet;
ReleaseDC( hWnd, hDC );
/* Save as DXF */
nRet = L_VecSaveFile( pszFileName, &TmpVector, FILE_DXF, NULL );
if(nRet != SUCCESS)
return nRet;
/* Free the vector */
nRet = L_VecFree( &TmpVector );
return nRet;
}