Programming with LEADTOOLS TWAIN Functions

LEADTOOLS TWAIN toolkits support both the TWAIN 1.9 and the TWAIN 2.x specifications. After the TWAIN driver is installed and configured for the system, programming with LEADTOOLS TWAIN can begin. LEADTOOLS provides functions for:

Getting Started

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 information necessary for acquiring, getting and setting information, managing TWAIN sources, and handling template files.

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

Next, select a specific TWAIN source from the sources installed on the system, or use the default TWAIN source. To do so, call L_TwainSelectSource. This must be done after a TWAIN session has been initialized.

By default the toolkit automatically checks for TWAIN 2.x support, and tries to load the TWAIN 2.x if it is supported. If that fails or if the scanner is not compatible with TWAIN 2.x, it will try to start TWAIN 1.9.

Instead of letting the toolkit automatically select the TWAIN version, the TWAIN version can be set explicitly by calling the L_TwainSetVersion function.

Determine which version of the TWAIN specification the LEADTOOLS toolkit is currently using by calling L_TwainGetVersion.

For more information, refer to Setting which TWAIN Specification Version to use and Managing the TWAIN Source.

Setting and Getting Capabilities Values

Each TWAIN source supports a specific set of capabilities. Capabilities can be set to the desired values before image acquisition, or default values can be used. 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, raster images and/or image data can be acquired. 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 a TWAIN Source.

It is possible to 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.

Saving Settings to Files

Capability settings used when acquiring images can be saved to a template file. They can then be obtained from the template file and used to acquire images from the same TWAIN source later, instead of getting and setting TWAIN capabilities each time. For more information, refer to Handling Template Files.

Freeing the TWAIN Session

Free the handle to the TWAIN session when it is no longer needed. For more information, refer to Freeing the TWAIN Session.

For more information, refer to:

Demo Programs

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS TWAIN C API Help