L_TwainGetScanConfigs

#include "lttwn.h"

L_LTTWN_API L_INT L_TwainGetScanConfigs(hSession, nBitsPerPixel, uTransferMode, nBufferIteration, ppFastConfig, uStructSize, pnFastConfigCount)

HTWAINSESSION hSession;

/* handle to an existing TWAIN session */

L_INT nBitsPerPixel;

/* bits per pixel */

L_UINT uTransferMode;

/* transfer mode */

L_INT nBufferIteration;

/* buffer iteration */

pFASTCONFIG *ppFastConfig;

/* address of a pointer to the FASTCONFIG structure */

L_UINT uStructSize;

/* size in bytes, of the structure pointed to by ppFastConfig */

L_INT *pnFastConfigCount;

/* pointer to an integer */

Gets the default scan configurations for the given transfer mode, buffer iteration and bits per pixel.

Parameter

Description

hSession

Handle to an existing TWAIN session. This handle is obtained by calling the L_TwainInitSession function.

nBitsPerPixel

The number of bits per pixel for which to get the default scan configurations.

uTransferMode

Transfer mode for which to get the default scan configurations.

 

Value

Meaning

 

LTWAIN_FILE_MODE

[0x001] Use File transfer mode

 

LTWAIN_BUFFER_MODE

[0x002] Use Memory transfer mode

 

LTWAIN_NATIVE_MODE

[0x004] Use Native transfer mode

nBufferIteration

Number used to determine the number of memory configurations that will be tested. This function uses this number to determine which default scan configurations to get.

ppFastConfig

Address of a pointer to a FASTCONFIG structure. This function will automatically allocate an array of FASTCONFIG structures using the total number of scan configurations. This array will be updated with the scan configurations retrieved based on the specified bits per pixel, transfer mode and number of buffers.

uStructSize

Size in bytes, of the structure pointed to by ppFastConfig, for versioning. Use sizeof(FASTCONFIG).

pnFastConfigCount

Pointer to an integer to be updated with number of scan configurations in ppFastConfig.

Returns

SUCCESS

The function was successful.

! = SUCCESS

An error occurred. Refer to Return Codes.

Comments

This function must be called after L_TwainStartCapsNeg is called and before L_TwainEndCapsNeg is called.

If uTransferMode is LTWAIN_NATIVE_MODE, this function will use the value of nBitsPerPixel to determine which scan configurations to get.

If uTransferMode is LTWAIN_BUFFER_MODE, this function will use both nBitsPerPixel and nBufferIteration to determine which scan configurations to get.

If uTransferMode is LTWAIN_FILE_MODE, this function will use the value of nBitsPerPixel to determine which scan configurations to get.

This function allocates storage for the array of scan configurations in ppFastConfig. When this storage is no longer needed, you must free the storage by calling L_TwainFreeScanConfig.

This function must be called after L_TwainStartCapsNeg is called and before L_TwainEndCapsNeg is called.

Required DLLs and Libraries

LTTWN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_TwainAcquire, L_TwainAcquireList, L_TwainInitSession, L_TwainEndSession, L_TwainOpenTemplateFile, L_TwainCloseTemplateFile, L_TwainTemplateDlg, L_TwainAddCapabilityToFile, L_TwainGetNumofCapsInFile, L_TwainGetCapabilityFromFile, L_TwainAcquireMulti, L_TwainFindFastConfig, L_TwainFreeScanConfig, L_TwainFastAcquire

Topics:

Fast TWAIN (Scan Configurations)

 

TWAIN Functionality: Fast TWAIN (Scan Configuration) Functions.

Example

For an example, refer to L_TwainFindFastConfig.