There are functions in the BiTWAIN.DLL and properties in the BiTWAIN.OCX for setting the acquisition mode.
You can scan to memory, to a file on disk or to the clipboard.
The difference between Acquire function and BatchScan function is that BatchScan always transfers the images to the BiTwain.dll in memory (TWSX_NATIVE mode) and uses the BiTIFF.dll to save the images to a TIFF file.
If a filename is given, Acquire function saves the images to disk directly in a format the scanner driver supports (TWSX_FILE mode), or returns a handle to a DIB if NULL is passed in the filename parameter (TWSX_NATIVE mode). When using Acquire with TWSX_FILE mode, the supported file type also depends on the scanner driver capability. Some scanner supports only bmp (bitmap) and some scanner supports multiple file types.
In the Twain C++ Sample, the “Software Batch Scan” option uses the BatchScan function; “Hardware Batch Scan” uses Acquire with TWSX_FILE mode.
Scanners are required to support TWSX_NATIVE transfer mode, but not required to support TWSX_FILE transfer mode, so BatchScan should work in all cases.
BiTwain.dll:
To Scan to Memory: Use the Acquire function with NULL parameter
To Scan to File: Use the Acquire function with a path and file name to scan to as a parameter
To Scan to the Clipboard: Use the AcquireToClipboard function
For Software Batch Scanning: Use the BatchScan function
For Hardware Batch Scanning: Use the Acquire function with a path and file name to scan to as a parameter and set the number of pages to scan using the SetAcquirePages function
BiTwain.ocx:
To Scan to Memory: Set the Action property to TWSCAN_ACQUIRE and the FileAcquire property should be empty
To Scan to File: Set the Action property to TWSCAN_ACQUIRE and the FileAcquire property will be the path and name of the file to scan
To Scan to the Clipboard: Set the Action property to TWSCAN_ACQUIRETOCLIPBOARD
For Software Batch Scanning: : Set the Action property to TWSTAT_BATCHSCAN and specify the batch scanning parameters
For Hardware Batch Scanning: Set the Action property to TWSCAN_ACQUIRE, set the FileAcquire property to the path and name of the file to scan, and set the number of pages to scan with SetAcquirePages method
[C++]
/* Acquire an image to a disk file */
#include “BiTwain.h”
/* 1. parameter: number of pages to scan It scans only one
page
2. parameter: the scans single page files or multipage
image */
SetAcquirePages(1, FALSE);
/* 1. parameter: Path and name of the file to scan */
Acquire(_T(“C:\\Images\\Test.tif”));
[C#]
/* Acquire an image to a disk file */
/*Path and name of the file to scan */
BiTwain.FileAcquire = “C:\\Images\\Test.tif”;
/* 1. parameter: number of pages to scan It scans only one
page
2. parameter: the scans single page files or multipage
image */
BiTwain.SetAcquirePages(1, false);
/* Start scanning */
BiTwain.Action =
(short)BITWAINLib.enumScanOperations.TWSCAN_ACQUIRE;