When the Disk File Transfer mode is used, the Data Source will save an image directly to a file. You must use the TWAIN capabilities to set all parameters involved in using Disk File Transfer. To do this, use the IG_TWAIN_cap_set() and IG_TWAIN_ctrl_set() functions. Below are two sample calls. The first sets the filename to "myfile.tif"; the second sets the file format to TIFF.
Copy Code | |
---|---|
IG_TWAIN_ctrl_set(IG_TW_CTRL_IMAGE_FILE_NAME, "myfile.tif", strlen("myfile.tif")); HTWAINCAP hTWAINCap = (HTWAINCAP)NULL; AT_LMODE nFileFormat = IG_FORMAT_TIF; nErrCount = IG_TWAIN_cap_create(IG_TW_ICAP_IMAGEFILEFORMAT, IG_TW_ON_ONEVALUE, AM_TID_META_UINT16, &hTWAINCap); nErrCount = IG_TWAIN_cap_value_set(hTWAINCap, (LPCVOID)nFileFormat, sizeof(nFileFormat)); nErrCount = IG_TWAIN_cap_set(hTWAINCap, IG_TW_MSG_SET); IG_TWAIN_cap_delete(hTWAINCap); |
Your choice of which file format to use for an image that is acquired and stored directly to a file is limited by two factors: (1) The file formats supported by your Scanner's Device Driver, (2) The file formats supported by TWAIN. |
The following formats are supported by TWAIN for image acquisition devices: TIFF, PICT, BMP, XBM, JPEG, FPX, PNG. Therefore, if you are using the Disk File Transfer, you are restricted to using a format that is both supported by TWAIN and supported by your Data Source.
If you do not specify a filename, the path to the temporary Windows directory will be used.
Remember that not all TWAIN-supported file formats are supported by all TWAIN-compliant Data Sources. If your Data Source does not support the file format that you specify, ImageGear will return an error. |
For additional information about using the Disk File Transfer syntax see the Scanning and Acquiring Pages subsection entitled "Using Disk File Transfer and IG_TWAIN_acquire()".