#include "ltwrappr.h"
virtual L_INT LVectorBase::ConvertToWMF(hdc, phMetaFile, uDPI, pRect = NULL)
Converts a LEAD Technologies vector handle into a Windows metafile (WMF). 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.
Handle to the device context responsible for the conversion.
Pointer to a metafile handle to be updated with the converted vector.
Dots per inch that should be used to do the conversion.
Pointer to a RECT structure that contains the dimensions, in .01 millimeter units, of the drawing to be stored in the metafile. If this parameter is NULL, the vector toolkit computes the dimensions of the smallest rectangle that bounds the vector drawing. This parameter should be provided whenever possible.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function allocates a WMF handle and copies the LEAD vector to the WMF.
If this function is called with pRect containing these values:
pRect->left = 0;
pRect->top = 0;
pRect->right = 1000;
pRect->bottom = 1000;
the vector drawing will be converted to an WMF file with logical size 0 to 10 mm. in width and height.
This is very helpful when printing. For example, determine the printers printable area in millimeters. Divide that value by 100 and pass the resulting value as the right and bottom members of the RECT structure. The resulting WMF will have the same logical size as the printer, resulting in high image quality when printing the WMF file.
Required DLLs and Libraries
L_INT LVectorBase__ConvertToWMFExample( HWND hWnd, L_TCHAR *pszFile, HMETAFILE& hWMF)
{
L_INT nRet;
LVectorBase Vector;
HDC hDC;
//Load the drawing
nRet = Vector.Load(pszFile);
if(nRet != SUCCESS)
return nRet;
//Convert to EMF
hDC = GetDC( hWnd );
nRet = Vector.ConvertToWMF(hDC, &hWMF, 96);
if(nRet != SUCCESS)
return nRet;
ReleaseDC( hWnd, hDC );
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.