LWia::AcquireCallBack

#include "ltwrappr.h"

virtual L_INT LWia::AcquireCallBack(pBitmap, pszFilename, uPercent, uFlags)

This function will be called after calling any of the LWia::Acquire or LWia::AcquireSimple functions. Be sure to first enable the callback functions by calling  LBase::EnableCallBack (TRUE).

Parameters

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle that references the bitmap acquired from the WIA source.

L_TCHAR * pszFilename

Character string containing the name of the file to which to save the scanned image(s). The pszFilename parameter is valid only if the transfer mode is set to file transfer.

L_UINT32 uPercent

The percent completion of the page being scanned.

L_UINT32 uFlags

Flag that indicates the starting or ending point of the scanned page. Possible values are:

Value Meaning
0 Default value, used when this is neither the first or the last transferred chunk.
L_WIA_ACQUIRE_START_OF_PAGE [0x00000001] Indicates the start of the page being scanned.
L_WIA_ACQUIRE_END_OF_PAGE [0x00000002] Indicates the end of the page being scanned. Use this value to reset the progress bar.

Returns

Value Meaning
SUCCESS The function was successful.
ERROR_USER_ABORT The callback wants to abort the scanning operation.
< 1 An error occurred. Refer to Return Codes.

Comments

This feature is available in LEADTOOLS version 16 or higher.

This callback will be called during acquisition in order to provide the percent completion for progress bar updates. At the end it provides the following information:

To prevent memory leaks, free the bitmap within the callback function.

Note: If WIA 2.0 is being used and the L_WIA_SHOW_USER_INTERFACE is set, there is no need to provide a callback pointer. (Microsoft's WIA 2.0 Acquire dialog does not provide a callback: instead, it performs all processing and returns the saved file count and paths.

Required DLLs and Libraries

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS WIA C++ Class Library Help