Fast TWAIN (Scan Configurations)
The performance of a TWAIN scanner can vary based on its scan configuration. The TWAIN driver of your TWAIN scanner comes with one or more "default" scan configurations. In addition, the user may create one or more user-defined scan configurations. LEAD provides several methods to determine the best and fastest scan configuration available, thereby letting you use the best and fastest scan configuration for scanning images.
To determine the best and fastest scan configuration for your TWAIN scanner, call FindFastConfig method. This method will test either an array of user-defined scan configurations, or all the default scan configurations present for the TWAIN driver of the current TWAIN scanner, based on the values of the pInFastConfigs and the nInFastConfigsCount parameters. For each scan configuration that is tested, the FindFastConfig method calls the OnFastConfigEvent Event if the EnableFastConfigEvent property was set to TRUE. This Event receives the information for the scan configuration being tested. This lets you interact with the scan configuration information as needed.
Since the list of default scan configurations present for a specific TWAIN driver can be rather numerous, you can narrow the list you wish to test using the GetScanConfigs method. This method gets default scan configurations based on the transfer mode, bits per pixel and number of buffers. Therefore, you can get a list of scan configurations for a specific transfer mode, pass this list of scan configurations to the FindFastConfig method, and decrease the number of default scan configurations that must be tested.
Both the FindFastConfig and the GetScanConfigs methods allocate storage for an array of FASTCONFIG structures that contains scan configurations. This storage must be freed by calling FreeScanConfig method, when the array is no longer needed.
Once the best scan configuration has been determined, the scan configuration information can be passed to the AcquireMulti method so the images will be acquired as fast as possible.