Programming with LEADTOOLS Twain COM Object
Once the TWAIN driver is installed and configured to the system, the user is ready to begin programming with the LEADTOOLS TWAIN COM object. LEADTOOLS provides functionality for:
Selecting and managing the available TWAIN sources installed on the system.
Acquiring images from a selected TWAIN source.
Handling different TWAIN sources, like scanners, barcode readers, and digital cameras.
LEADTOOLS TWAIN COM object must be registered before working with any of the TWAIN properties, methods or events. For more information refer to Registering and Unregistering the TWAIN COM Object.
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 select to use the TWAIN source's default values for the capabilities. LEADTOOLS provides support for working with capabilities in the following ways:
Enumerating the capabilities supported by the source and getting their values.
Setting or resetting defined values of a specific capability for the selected TWAIN source.
Getting all supported capabilities, and their associated values, supported by the TWAIN source.
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 be loaded 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 TWAIN session is no longer needed, the internal handle should be freed. For more information, refer to Freeing the TWAIN Session.