typedef struct _DATATRANSFER
{
L_UINT uStructSize;
L_INT nFillOrder;
L_INT nBufMemCompression;
L_INT nTransferMode;
L_INT nScanFileFormat;
L_INT nMemBufSize;
L_BOOL bSaveToOneFile;
L_BOOL bAppendToFile;
L_BOOL bDumpMemBufsToFile;
L_TCHAR szFileName [250];
} DATATRANSFER, * pDATATRANSFER;
The DATATRANSFER structure provides information about data transferring.
Size of the DATATRANSFER structure, in bytes, for versioning. Use the sizeof() operator to calculate the value.
Indicates how bytes in the image are to be filled by the source. Possible values are (according to the TWAIN specification):
Value | Meaning |
---|---|
TWBO_LSBFIRST | Bytes are to be transferred with the least significant byte first. |
TWBO_MSBFIRST | Bytes are to be transferred with the most significant byte first. |
Specifies the compression to be used when having the transfer mode set to be memory. Possible values are (according to the TWAIN specification):
Value | Meaning |
---|---|
TWCP_NONE | No compression is to be used. |
TWCP_PACKBITS | Pack Bits compression. |
TWCP_GROUP31D | CCITT Group 3 compression with no End of Line. |
TWCP_GROUP31DEOL | CCITT Group 3 compression with End of Line. |
TWCP_GROUP32D | CCITT Group 3 compression (use cap for K Factor). |
TWCP_GROUP4 | CCITT Group 4 compression. |
TWCP_JPEG | JPEG compression. |
TWCP_LZW | LZW compression (like gifs). |
TWCP_JBIG | JBIG compression, used mostly for bitonal images. |
TWCP_PNG | PNG compressed. |
TWCP_RLE4 | RLE4 compression. |
TWCP_RLE8 | RLE8 compression. |
TWCP_BITFIELDS | Bit Fields compression. |
Transfer mode to be used by the TWAIN source. Possible values are (according to the TWAIN specification):
Value | Meaning |
---|---|
TWSX_NATIVE | Native transfer mode. |
TWSX_MEMORY | Memory buffered transfer mode. The source will be transferring strips of data to the application according to the buffer size given. |
TWSX_FILE | File transfer mode. This will use a specified file to have the image data saved to. This will have a certain format specified by the properties. |
Determines the file format to use when saving the files from the TWAIN source when nTransferMode is TWSX_FILE. Possible values are (according to the TWAIN specification) :
Value | Meaning |
---|---|
TWFF_TIFF | Tagged image file. |
TWFF_PICT | Macintosh PICT. |
TWFF_BMP | Windows regular bitmap. |
TWFF_XBM | X-Windows bitmap. |
TWFF_JFIF | JPEG file interchange format. |
TWFF_FPX | Flash pix file. |
TWFF_TIFFMULTI | Multipage tiff file format. |
TWFF_PNG | PNG file. |
TWFF_SPIFF | SPIFF file. |
TWFF_EXIF | EXIF file. |
Specifies the memory buffer size to be used in data transfer.
Flag that indicates whether to save multiple pages to a single file. Possible values are:
Value | Meaning |
---|---|
TRUE | Save to a single file. |
FALSE | Do not save to a single file. |
Flag that indicates whether to append pages to the end of the file when saving a multipage file. Possible values are:
Value | Meaning |
---|---|
TRUE | Append pages to the end of the file. |
FALSE | Do not append pages to the end of the file. |
Flag that indicates whether to use the file name specified in szFileName field to dump the memory buffers received from the scanner. In this case the Bitmap Handle will not get the Bitmap Data: all the data will be saved to the file. Possible values:
Value | Meaning |
---|---|
TRUE | Use the file name. |
FALSE | Do not use the file name. |
Character string that contains the file name used in the file transfer mode. Use this member only if:
The nTransferMode member is set to TWSX_FILE.
Or
The nTransferMode member is set to TWSX_MEMORY and the bDumpMemBufsToFile member is set to TRUE.
pDATATRANSFER is a pointer to a DATATRANSFER structure. Where the function parameter type is pDATATRANSFER, you can declare a DATATRANSFER variable, update the structure's fields and pass the variable's address in the parameter. Declaring a pDATATRANSFER variable is necessary only if your program requires a pointer.
DATATRANSFER is used with the LTWAINPROPERTIES structure.
If the nTransferMode member value is set to TWSX_MEMORY and the bDumpMemBufsToFile member value is set to TRUE, then the LTwain::Acquire and LTwain::AcquireList functions will dump the memory buffers received from the scanner (whether compressed or not) directly to the output file specified by szFileName member.
If the nTransferMode member value is set to TWSX_MEMORY, the nBufMemCompression member is set to values other than TWCP_NONE, and the bDumpMemBufsToFile member value is set to FALSE, then the LTwain::Acquire and LTwain::AcquireList functions will decompress the memory buffers received from the scanner, and generate a BITMAPHANDLE as a result.
This generated BITMAPHANDLE will be:
LTwain::Acquire
functionOr
LTwain::AcquireList
function when this function is being used.