#include "lvkrn.h"
L_LVKRN_API L_INT L_VecLoadLayout(pszFile, pVector, nLayoutIndex, pLayoutInfo)
L_TCHAR pszFile; |
filename |
pVECTORHANDLE pVector; |
pointer to a vector handle |
L_INT nLayoutIndex; |
layout index |
pLAYOUTINFO pLayoutInfo; |
pointer to a structure |
Loads the specified layout from the specified file. Currently only DXF files support layouts.
Parameter |
Description |
pszFile |
Character string that contains the name of the file to load. |
pVector |
Pointer to a vector handle referencing the loaded image. |
nLayoutIndex |
A zero-based index of the layout to load. Pass 0 to load the first layout, 1 to load the second layout, etc. |
pLayoutInfo |
Pointer to a LAYOUTINFO structure to be updated with information of loaded layout. Pass NULL for this parameter if layout information is not needed. If this parameter contains a valid pointer to a LAYOUTINFO structure, the uStructSize member should be set to the sizeof (LAYOUTINFO) before calling this function. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Loads a vector image into a vector handle. The file can be any vector file format that supports layouts (currently DXF).
The L_VecLoadLayout function initializes the vector handle and allocates the storage necessary to hold the vector image.
Since the function allocates storage to hold the image, it is up to the user to free this storage by calling the L_VecFree function.
You should never pass an uninitialized FILEINFO structure to this function.
Required DLLs and Libraries
LVKRN |
Functions: |
|
Topics: |
This example loads a specific layout from a vector image. Currently only DXF files support layouts
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName
L_INT VecLoadLayoutExample(L_VOID)
{
VECTORHANDLE LeadVector; /* Vector handle to hold the loaded image. */
L_INT nRet; /* Return value. */
LAYOUTINFO LayoutInfo; /* Layout info */
/* Load layout 1 of vector image. */
nRet = L_VecLoadLayout(MAKE_IMAGE_PATH(TEXT("FILE1.DXF")), &LeadVector, 1, &LayoutInfo );
if( nRet != SUCCESS )
/* There was an error loading the vector image. */
MessageBox( NULL, TEXT("Could not load file!"), TEXT("Error"), 0 );
return nRet;
}