L_VecLoadFile

#include "lvkrn.h"

L_LVKRN_API L_INT L_VecLoadFile(pszFile, pVector, pLoadOptions, pFileInfo)

L_TCHAR pszFile;

/* filename */

pVECTORHANDLE pVector;

/* pointer to a vector handle */

pLOADFILEOPTION pLoadOptions;

/* pointer to a structure */

pFILEINFO pFileInfo;

/* pointer to a structure */

Loads an image from a file into a vector handle. The file can be any supported file format, compressed or uncompressed.

Parameter

Description

pszFile

Character string that contains the name of the file to load.

pVector

Pointer to a vector handle referencing the loaded image.

pLoadOptions

Reserved for future use. Pass NULL.

pFileInfo

Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.

 

If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo.

 

If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_ONLYFORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo.

 

If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Loads a vector image into a vector handle. The file can be any supported vector file format.

The function will initialize the vector handle and allocate the storage necessary to hold the vector image.

Since the function allocates storage to hold the image, it is up to you to free this storage by calling L_VecFree.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecAttachToWindow, L_VecSaveFile

Topics:

 

Example

This example loads a vector image.

L_INT VecLoadFileExample(L_VOID)
{
   VECTORHANDLE   LeadVector; /* Vector handle to hold the loaded image. */
   L_INT          nRet;       /* Return value. */

   /* Load the vector image. */
   nRet = L_VecLoadFile(TEXT("C:\\Program Files\\LEAD Technologies\\LEADTOOLS 15\\Images\\FILE1.DXF"), &LeadVector, NULL, NULL );

   if( nRet != SUCCESS )
      /* There was an error loading the vector image. */
      MessageBox( NULL, TEXT("Could not load file!"), TEXT("Error"), 0 );

   return nRet;
}