Loads the specified layout from the specified file. Currently only DXF files support layouts.
#include "ltvkrn.h"
L_LVKRN_API L_INT L_VecLoadLayout(pszFile, pVector, nLayoutIndex, pLayoutInfo)
Character string that contains the name of the file to load.
Pointer to a vector handle referencing the loaded image.
A zero-based index of the layout to load. Pass 0 to load the first layout, 1 to load the second layout, etc.
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.
Value | Meaning |
---|---|
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.
This example loads a specific layout from a vector image. Currently only DXF files support layouts
L_LTVKRNTEX_API 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;
}