Programming with LEADTOOLS TWAIN Functions

Once the TWAIN driver is installed and configured to the system, the user is ready to begin programming with LEADTOOLS TWAIN. LEADTOOLS provides functions for:

The user can select the TWAIN version to work with using the LTwain::SetVersion function. The available TWAIN versions are TWAIN v1.0 and v2.0 (the default).

LEADTOOLS uses a TWAIN session handle to provide the means for acquiring pages from the TWAIN source. The TWAIN session handle is a communication session between LEADTOOLS TWAIN and a TWAIN driver installed on the system. This TWAIN handle is a pointer to an internal structure that contains all the necessary information for acquiring, getting and setting information, managing the TWAIN sources, and handling template files.

Getting Started

To begin using the available features in the LEADTOOLS TWAIN toolkit, the user should initialize a TWAIN session. For more information, refer to Initializing a TWAIN Session.

The user can now, select a specific TWAIN source from the sources installed on the system, or use the default TWAIN source. This must be done after the user has initialized a TWAIN session. For more information, refer to Managing the TWAIN Source.

Setting and Getting Capabilities Values

Each TWAIN source has a set of supported capabilities. The user may set these capabilities to some desired value before acquiring the image(s) or the user may elect to use the TWAIN source's default values for the capabilities. LEADTOOLS provides functions for working with capabilities in the following ways:

For more information, refer to Getting and Setting Capabilities.

Acquiring Images or Image Data

After the desired TWAIN source capabilities have been set, the user can start acquiring raster images and/or image data. Image data is related to the data acquired from a barcode, if the selected TWAIN source is the barcode reader.

For more information, refer to How to Acquire from the TWAIN Source.

The user can obtain information from the TWAIN file system, and change the settings within the TWAIN file system. For more information, refer to Getting or Setting TWAIN File System Information.

Save Settings to Files

The user can save the capability settings, used when acquiring images, in a template file. These capability settings can then obtained from the template file and used to acquire images from the same TWAIN source later, instead of getting and setting the TWAIN capabilities each time. For more information, refer to Handling Template Files.

Freeing the TWAIN Session

When the handle to the TWAIN session is no longer needed, it should be freed. For more information, refer to Freeing the TWAIN Session.

For more information, refer to:

Demo Programs

LEAD Scanning/Capture Support Forum

See Also:

Introduction

Microsoft Code Snippet Picker

LEADTOOLS Support Forums

Getting Started with LEADTOOLS