DTWAIN_GetAcquireStripData

Top  Previous  Next

The DTWAIN_GetAcquireStripData function gets the information concerning the current strip that was acquired when a buffered transfer is in progress.

 

DTWAIN_BOOL DTWAIN_GetAcquireStripData (

DTWAIN_SOURCE

Source,

LPLONG

lpCompression,

LPLONG

lpBytesPerRow,

LPLONG

lpColumns,

LPLONG

lpRows,

LPLONG

lpXOffset,

LPLONG

lpYOffset,

LPLONG

lpBytesWritten );

 

Parameters

Source

An open TWAIN Source.

 

lpCompression

Pointer to a LONG that will receive the compression used, or NULL if this parameter should be ignored.

 

lpBytesPerRow

  Pointer to a LONG that will receive the number of uncompressed bytes in each row, or NULL if this parameter should be ignored.

 

lpColumns

  Pointer to a LONG that will receive the number of uncompressed columns (in pixels) in the buffer, or NULL if this parameter should be ignored.

 

lpRows

  Pointer to a LONG that will receive the number of uncompressed rows (in pixels) in the buffer, or NULL if this parameter should be ignored.

 

lpXOffset

  Pointer to a LONG that will receive how far from the left edge the data in the buffer is inset, or NULL if this parameter should be ignored.

 

lpYOffset

  Pointer to a LONG that will receive how far from the top edge the data in the buffer is inset, or NULL if this parameter should be ignored.

 

lpBytesWritten

  Pointer to a LONG that will receive the number of bytes written in the buffer, or NULL if this parameter should be ignored.

 

 

Return Values

The return value is TRUE if successful.  Otherwise FALSE is returned.

 

Comments

The DTWAIN_GetAcquireStripData function gets the data that describes the latest strip of data that was transferred when the buffered memory transfer has been invoked.  DTWAIN_GetAcquireStripData should be called only when an application receives the DTWAIN_TN_TRANSFERSTRIPDONE and DTWAIN_TN_ACQUIREDONE notifications.  The application must process DTWAIN Notifications to use this function correctly.

 

For most purposes, this function is used when an application decides to handle the strips of data that are acquired for buffered transfers by installing a user-defined buffer.  However, DTWAIN_GetAcquireStripData can be used even if there is no user-defined buffer.   For more information and an example, please read the section in the user manual Using a User-Defined Buffer and Buffered Transfers.

 

Below is a definition of the values for the strip of data:

 

Strip Component

Definition

 

Compression

The compression method used to process the data being transferred.   This will be equal to one of the DTWAIN Compression constants.

 

BytesPerRow

The number of uncompressed bytes in each row of the piece of the image being described in the buffer.

 

Columns

The number of uncompressed columns (in pixels) in this buffer.

 

Rows

The number or uncompressed rows (in pixels) in this buffer.

 

XOffset

How far, in pixels, the left edge of the piece of the image being described by this structure is inset from the "left" side of the original image. If the Source is transferring in "strips", this value will equal zero.  Since DTWAIN currently only supports strips, this value will always equal 0.

 

YOffset

 

Same as XOffset, but the measure is in pixels from the "top" of the original image to the upper edge of the strip.

 

BytesWritten

The number of bytes written into the transfer buffer.

 

 

Bufffered images are acquired when a call to

 

DTWAIN_AcquireBuffered is invoked
DTWAIN_AcquireFile or DTWAIN_AcquireFileEx is called with the DTWAIN_USEBUFFERED flag is used,
DTWAIN_AcquireToClipboard when DTWAIN_USEBUFFERED flag is used.

 

TWAIN State Transitions

The Source must be in State 6 or 7.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

 

DTWAIN Source Selection Function

 

DTWAIN_AcquireBuffered / DTWAIN_AcquireFile / DTWAIN_AcquireFileEx/ DTWAIN_AcquireToClipboard

 

See Also

Buffered Image Transfer Support