TransferMode

Description

Returns or sets the Data Source's transfer mode.

Data type

enumTW_TRANSFERMODE

Syntax

.TransferMode = EnumDWT_TransferMode.TWSX_FILE;

Remarks

Use this property after OpenSource() and before AcquireImage().

Value Description
TWSX_NATIVE (0) NATIVE mode is the default mode. In this mode, the whole
image is transfered in a single memory block.
TWSX_FILE (1) DISK FILE mode is not required by TWAIN specification.
In this mode, the image is transfered to a specified file directly. The disk file mode is ideal when transferring large images that might encounter memory limitations with Native mode.
TWSX_MEMORY (2) MEMORY mode is also required by TWAIN, like NATIVE mode. Although this mode is the
most complex, Dynamic TWAIN handles the tranfer details, making it as simple
as NATIVE mode.

The default value for TransferMode is TWSX_NATIVE (0).

For DISK FILE mode - TWSX_FILE (1), since it is not required by TWAIN, the application needs to make sure it is supported by the current Source. One way to do this is to check the TransferMode property after OpenSource() and see if it is still TWSX_FILE (1). The following is a sample:

When an error occurs, check ErrorCode or ErrorString for error information.

Example

    DWObject.OpenSource();
    DWObject.TransferMode = EnumDWT_TransferMode.TWSX_FILE;
    if(DWObject.TransferMode == EnumDWT_TransferMode.TWSX_FILE){
        if(DWObject.SetFileXferInfo("C:\\WebTWAIN.bmp", EnumDWT_FileFormat.TWFF_BMP)){
            DWObject.IfShowUI = false;		
            DWObject.AcquireImage(); 
        }
    }

See also

SetFileXferInfo()