FindFastConfig method (ILEADRasterTwain)

Visual Basic Example

Visual C++ 5.0 Example

 

Syntax

short FindFastConfig(BSTR bstrWorkingFolder, long lFlags, short iBitsPerPixel, short iBufferIteration)

Overview

Refer to Fast TWAIN (Scan Configurations)

Remarks

(Document/Medical only) Determines the best scanner configuration.

This method will test scan configurations for the scanner selected using the SelectSource method. It will update the BestFastConfig property with the best/fastest scan configuration tested. Using the fastest scan configuration lets you scan images in as fast as possible. Once the best scan configuration has been determined, the scan configuration's values for the transfer mode, bits per pixel, format and buffer size can be set by setting the FastTransferMode property, FastFormat property, FastBitsPerPixel property, FastBufferSize property and FastUsePreferredBufferSize property before calling the AcquireMulti method, so the images can be scanned as fast as possible.

To test user-defined/custom configurations, set the number of user-defined scan configurations in the UserFastConfigsCount property, then assign the scan configurations to the UserFastConfigs property.

To test the default configurations available for the Twain driver, set the UserFastConfigsCount property to 0.

The list of default scan configurations to test can be shortened by using the GetScanConfigs method to get a list of default scan configurations based on transfer mode, bits per pixel and number of buffers. The ScanConfig property is updated with the retrieved list of scan configurations. Next, assign the value of the ScanConfigCount property to the UserFastConfigsCount property. Then, assign the array of scan configurations in the ScanConfig property to the UserFastConfigs property. Call the FindFastConfigs method to determine the best and fastest scan configuration.

If L_LTWAIN_CHECK_ALL_DEFAULT_BPP is set in lFlags then the method will test all supported bits per pixel for the selected scanner. If this flag is not set in lFlags, then the method will test the bits per pixel specified in the iBitsPerPixel parameter.

If L_LTWAIN_USE_THREAD_MODE is set in lFlags, then the image acquisition process will run in thread mode. In some scanners, acquiring images in thread will improve the speed at which the image(s) is(are) acquired. In other scanners, high-speed scanners, for example, acquiring the image(s) in thread mode will provide little to no improvement in the speed at which the image(s) is(are) acquired.

The iBitsPerPixel parameter and the L_LTWAIN_CHECK_ALL_DEFAULT_BPP flag will be used only if the transfer mode for the scan configuration being tested is L_LTWAIN_BUFFER_MODE or L_LTWAIN_NATIVE_MODE.

The iBufferIteration parameter will be used only if the FastTransferMode property for the scan configuration being tested is L_LTWAIN_BUFFER_MODE. The buffer iteration value determines the buffer sizes to be tested. The purpose for testing the memory transfer mode with different buffer sizes is to determine the buffer size that will provide the fastest scan configuration. The buffer iteration specifies the number of buffer sizes that will be tested. The buffer size is the size of the transferred data from the Twain source.

To stop the scan configuration testing process, set the StopFindFastConfig property to TRUE within the FastConfigEvent event. The StopFindFastConfig property must be set to FALSE to continue the scan configuration process.

See Also

Elements

EnableFastConfigEvent property, UserFastConfigs property, UserFastConfigsCount property, FastConfigsResult property, FastConfigsResultCount property, BestFastConfig property, StopFindFastConfig property, FastConfigEvent event

Topics

Twain Functionality: Fast TWAIN (Scan Configurations)