DTWAIN_GetBufferedTransferInfo
The DTWAIN_GetBufferedTransferInfo obtains the image information for each strip or tile transferred when a buffered transfer is occuring.
HANDLE DTWAIN_GetBufferedTransferInfo (
Parameters Source Specifies a TWAIN Source.
pCompression Pointer to an unsigned 32-bit value that will contain the compression used when DTWAIN_GetBufferedTransferInfo returns. If this value is NULL or 0, this argument is ignored.
pBytesPerRow Pointer to an unsigned 32-bit value that will contain the bytes-per-row for the transferred strip or tile when DTWAIN_GetBufferedTransferInfo returns. If this value is NULL or 0, this argument is ignored.
pColumns Pointer to an unsigned 32-bit value that will contain the bytes-per-row for the transferred strip or tile when DTWAIN_GetBufferedTransferInfo returns. If this value is NULL or 0, this argument is ignored.
pRows Pointer to an unsigned 32-bit value that will contain the rows for the transferred strip or tile when DTWAIN_GetBufferedTransferInfo returns. If this value is NULL or 0, this argument is ignored.
pXOffset Pointer to an unsigned 32-bit value that will contain the xOffset for the transferred strip or tile when DTWAIN_GetBufferedTransferInfo returns. This value will always be 0 for strips. If this value is NULL or 0, this argument is ignored.
pYOffset Pointer to an unsigned 32-bit value that will contain the yOffset for the transferred strip or tile when DTWAIN_GetBufferedTransferInfo returns. This value will always be 0 for strips. If this value is NULL or 0, this argument is ignored. pFlags Pointer to an unsigned 32-bit value that will contain the flags that was sent by DTWAIN denoting the flags used by the buffered transfer with respect to the ownership of the memory handling. If this value is NULL or 0, this argument is ignored.
pBytesWritten Pointer to an unsigned 32-bit value that will contain the bytes written for the transferred strip or tile when DTWAIN_GetBufferedTransferInfo returns. If this value is NULL or 0, this argument is ignored.
pMemoryLength Pointer to an unsigned 32-bit value that will contain the number of bytes the returned HANDLE value contains. If this value is NULL or 0, this argument is ignored.
Return Values If the function succeeds, a valid HANLDE is returned, or NULL if the function fails.
Comments The DTWAIN_GetBufferedTransferInfo function allows an application to inspect and process the information concerning each strip or tile that is transferred using buffered transfers. The buffered transfer are initiated with a call to DTWAIN_AcquireBuffered or DTWAIN_AcquireBufferedEx. This function is usually called during DTWAIN notification processing, and processing the DTWAIN_TN_TRANSFERSTRIPDONE and DTWAIN_TN_TRANSFERTILEDONE notifications. The return value is a HANDLE to the image data that the source generated for the strip or tile. To get access to the data, a call to the Windows API function GlobalLock() should be done to get a pointer to the image data. For strip transfers, an application can call DTWAIN_GetBufferedTransferInfo to obtain details on the strip that was transferred. For tiled transfers, the application can get information on the tile that was transferred, and the image data that was transferred. Since DTWAIN doesn't do any processing of the actual tiled data, the application must use DTWAIN_GetBufferedTransferInfo, along with processing the DTWAIN_TN_TRANSFERTILEDONE notification to properly process the data. Note that the values filled in by DTWAIN_GetBufferedTransferInfo are the same ones produced by TWAIN's TW_IMAGEMEMXFER structure. Thus you should be familiar with TWAIN and how TW_IMAGEMEMXFER is used if you are to utilize DTWAIN_GetBufferedTransferInfo appropriately. Refer to the TWAIN specification document for more information on TW_IMAGEMEMXFER.
TWAIN State Transitions The source must be opened in State 6
Prerequisite Function Call(s)
DTWAIN Source Selection Function
See Also |