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).
#include "ltwrappr.h"
virtual L_INT LWia::AcquireCallBack(pBitmap, pszFilename, uPercent, uFlags)
Pointer to the bitmap handle that references the bitmap acquired from the WIA source.
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.
The percent completion of the page being scanned.
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. |
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. |
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.
For an example, refer to LWia::IsAvailable.