How to Acquire from the TWAIN Source

After the user has initialized a TWAIN session, selected a TWAIN source, and set the desired capabilities of the TWAIN source, he or she is ready to acquire images or image data from that source. LEADTOOLS provides the following for acquiring images and image data from a TWAIN source:

image\sqrblit.gif The Acquire method acquires one or more images from a TWAIN source. If the user has set EnableAcquirePageEvent to TRUE, the OnAcquirePageEvent Event will receive each image acquired from the source. This allows the user to process each image as desired. Within the OnAcquirePageEvent Event the user can call the GetExtendedImageInfo method to get extended image information that is included if the TWAIN source is a barcode reader or a digital camera.

To create extended image information using an image information array, use the CreateExtendedInfo method.

To get specific image information call the GetExtendedInfo method.

Use the FreeExtendedImageInfoStructure method to free the TW_EXTIMAGEINFO structure that the GetExtendedImageInfo method retrieves.

For more information about TW_EXTIMAGEINFO, refer to the TWAIN 1.9 specification from the site www.twain.org.

image\sqrblit.gif The AcquireMulti method acquires one or more images from a TWAIN source and saves the image(s) to one or more files. If the file format used does not support multi-page files, then the images will be saved to a series of files named by appending the image number to a base file name. If the file format used does support multi-page files, then the image(s) will be saved to one or more files based on the bMultiPageFile parameter. If this parameter is set to FALSE, then images will be saved to a series of files named by appending the image number to a base file name. If this parameter is set to TRUE, the image(s) will be saved to one multi-page file named using only the base file name.

If you set the EnableAcquireMultiEvent property to TRUE, the OnAcquireMultiEvent Event will be called twice for each page scanned using the AcquireMulti method. It is called the first time when the Twain source begins scanning the page. It is called the second time when the Twain source has finished scanning the page.

The methods listed above can acquire images in the following transfer modes:

Transfer Mode

Meaning

Native

Gets the bitmaps being scanned into the memory as a whole.

Memory Buffered

Gets images from the source as strips of data. These strips can be merged to get the whole image.

File

Gets the images from the source to a disk file.