LVectorWindow::Load

#include "ltwrappr.h"

virtual L_INT LVectorWindow::Load(pszFile, nEngine=VECTOR_ENGINE_GDI, dwFlags=VECTOR_ENGINE_DOUBLEBUFFER, pLoadOption=NULL, pFileInfo=NULL)

virtual L_INT LVectorWindow::Load(pLoadOption=NULL, pFileInfo=NULL)

Loads a vector image from disk into the class object. The image file can be in any supported vector file format. For supported vector formats, refer to Summary of Supported Vector File Formats.

Parameters

L_TCHAR * pszFile

Character string containing the name of the file to load.

L_UINT32 dwFlags

Flags that modify the vector engine. Possible values are:

Value Meaning
VECTOR_ENGINE_DOUBLEBUFFER Use double buffering for flicker-free screen updates.

pLOADFILEOPTION pLoadOption

Pointer to a LOADFILEOPTION structure that contains information on loading the file. Pass NULL to use the default load options.

pFILEINFO 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 LFile::GetInfo.

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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.

If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo 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

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

Comments

Call this function to load a vector image from disk into the class object.

The class object will free the vector when it is destroyed. If you wish to free the vector, use LVectorWindow::Free, which will clear the currently displayed vector from the LVectorWindow object.

You should never pass an uninitialized FILEINFO structure to this function.

Required DLLs and Libraries

See Also

Functions

Example

// This is an example for LVectorWindow::Load(pszFile, pLoadOption=NULL, pFileInfo=NULL): 
// Assumes pVectorWindow points to a valid LVectorWindow object. 
 
L_INT LVectorWindow__LoadExample_1(LVectorWindow *pVectorWindow) 
{ 
   L_INT nRet; 
 
   // Load a file 
   nRet = pVectorWindow->Load(MAKE_IMAGE_PATH(TEXT("random.dxf"))); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
 
// This is an example for LVectorWindow::Load(pLoadOption=NULL, pFileInfo=NULL): 
//Assumes pVectorWindow points to a valid LVectorWindow object 
 
L_INT LVectorWindow__LoadExample_2(LVectorWindow *pVectorWindow) 
{ 
   L_INT nRet; 
 
   pVectorWindow->SetFileName(MAKE_IMAGE_PATH(TEXT("random.dxf"))); 
 
   nRet = pVectorWindow->Load(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C++ Class Library Help