L_VecConvertFromEMF

Summary

Converts an enhanced Windows metafile (EMF) into a LEAD Technologies vector handle. When this function is completed, there are two copies of the drawing in memory: the EMF and the original LEAD vector. Freeing one will not affect the other. This function is available in the LEADTOOLS Vector Imaging Toolkit.

Syntax

#include "ltvkrn.h"

L_LVKRN_API L_INT L_VecConvertFromEMF(hDC, pVector, hEMF)

Parameters

L_HDC hDC

Handle to the device context responsible for the conversion.

pVECTORHANDLE pVector

Pointer to a vector handle.

L_HENHMETAFILE hEMF

Handle to the EMF to be converted.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

This function updates information in the vector handle and copies the EMF drawing data into the LEAD bitmap.

Required DLLs and Libraries

See Also

Functions

Example

This example converts an enhanced windows metafile into a DXF file.

L_INT VecConvertFromEMFExample( 
   HWND hWnd, 
   L_TCHAR* pszFileName, 
   HENHMETAFILE hEMF) 
{ 
   L_INT nRet; 
   VECTORHANDLE TmpVector;     /* Vector handle for initial conversion */ 
   HDC hDC; 
 
   /* Convert to LEAD vector */ 
   hDC = GetDC( hWnd ); 
   nRet = L_VecConvertFromEMF( hDC, &TmpVector, hEMF ); 
   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; 
} 

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.