User Guide > How to Work with... > Common Operations > Scanning > TWAIN Scanning > Set the TWAIN Image Acquisition Mode |
There are three acquisition modes in TWAIN:
Remember that not all of the TWAIN-supported transfer syntax modes are supported by all Data Sources. If you try to use an acquisition mode that your device does not support, you will receive an error message. |
Tell ImageGear the transfer mode to use with the function IG_TWAIN_cap_set().
Copy Code
|
|
---|---|
AT_ERRCOUNT SetTransferMode(DWORD dwXferMode) { AT_ERRCOUNT errorCount = 0; HTWAINCAP hTWAINCap = (HTWAINCAP)NULL; errorCount = IG_TWAIN_cap_create(IG_TW_ICAP_XFERMECH, IG_TW_ON_ONEVALUE, AM_TID_META_UINT16, &hTWAINCap); errorCount += IG_TWAIN_cap_value_set(hTWAINCap, (LPCVOID)dwXferMode, sizeof(dwXferMode)); errorCount += IG_TWAIN_cap_set(hTWAINCap, IG_TW_MSG_SET); errorCount += IG_TWAIN_cap_delete(hTWAINCap); return errorCount; } |
Copy Code
|
|
---|---|
AT_ERRCOUNT errorCount = 0; // Set to Disk File Transfer mode errorCount = SetTransferMode(IG_TW_SX_FILE); // Set to Buffered Memory Transfer mode errorCount = SetTransferMode(IG_TW_SX_MEMORY); // Set to Native Transfer mode errorCount = SetTransferMode(IG_TW_SX_NATIVE); |
By default, if no call is made to set transfer mode, ImageGear will use the mode set in Data Source.