Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS Vector C++ Class Library Help

LVectorWindow::Load

Show in webframe

#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)

L_TCHAR * pszFile;

/* name of the file to load */

L_UINT32 dwFlags;

/* flags */

pLOADFILEOPTION pLoadOption;

/* pointer to optional extended load options */

pFILEINFO pFileInfo;

/* pointer to a structure */

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.

Parameter

Description

pszFile

Character string containing the name of the file to load.

dwFlags

Flags that modify the vector engine. Possible values are:

 

 

Value

Meaning

 

VECTOR_ENGINE_DOUBLEBUFFER

Use double buffering for flicker-free screen updates.

pLoadOption

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

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

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

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:

Class Members

Example

#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName
// 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;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.