LWia::Acquire

Summary

Acquires one or more images from a WIA source.

Syntax

#include "ltwrappr.h"

virtual L_INT LWia::Acquire(uFlags, pSourceItem, pAcquireOptions, pnFilesCount, pppszFilePaths)

Parameters

L_UINT32 uFlags

Flag that determines certain actions of the WIA image acquisition selection dialog box. Possible values are:

Value Meaning
0 Default behavior for the device image acquisition dialog box.
L_WIA_DEVICE_DIALOG_SINGLE_IMAGE [0x00000002] Restrict image selection to a single image in the device image acquisition dialog box. This flag is not available if you are using WIA version 2.0.
L_WIA_SHOW_USER_INTERFACE [0x00000003] Show the manufacturer's image acquisition dialog box. For more information, see L_WIA_SHOW_USER_INTERFACE Note.
L_WIA_DEVICE_DIALOG_USE_COMMON_UI [0x00000004] Use the system user interface (UI), if available, rather than the vendor-supplied UI. If the system UI is not available, the vendor UI is used.

L_VOID * pSourceItem

Specifies the scanner's paper source (Feeder or Flatbed). Used only when acquiring from a scanner device and while the L_WIA_SHOW_USER_INTERFACE flag is NOT set.

This flag is optional if you are using WIA 1.0, because you can change the paper source by changing the WIA_DPS_DOCUMENT_HANDLING_SELECT property for the root item, or by enumerating the available scanner items and passing the item you wish to scan from.

If you are using WIA 2.0, then you have to enumerate the available scanner items and pass the item you wish to scan from. Or you can pass NULL, in which case the enumeration will be done internally and the first enumerated item will be used as the source item.

pLWIAACQUIREOPTIONS pAcquireOptions

Pointer to an optional Acquire Options structure containing information for controlling the acquisition behavior from the WIA device.

Pass NULL to use the internal default values.

L_INT * pnFilesCount

Pointer to a variable of type L_INT to be updated with the number files saved when acquiring using the File Mode.

L_TCHAR *** pppszFilePaths

Pointer to a string buffer to hold an array of the saved file paths. Used when the transfer mode is file.

You can define a variable of type L_TCHAR*** of size zero and pass the address of that variable to the acquire function.

It is the user's responsibility to free the received file name array.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

This feature is available in LEADTOOLS version 16 or higher.

[LWia:Acquire acquires single or multiple images from the selected WIA device.

Make sure to call LWia::InitSession and then call any of the LWia::SelectDeviceDlg or LWia::SelectDevice functions before calling [LWia:Acquire.

Specify the parent window for the image acquisition dialog by calling LScanner::SetWindow.

When performing memory transfer, override the LWia::AcquireCallBack function in order to receive the acquired page(s) through the pBitmap parameter of this callback. The callback also provides the percent completion of the page transfer progress.

When performing file transfer, overriding the LWia::AcquireCallBack function is optional since the callback only provides the saved file path and the percent completion of the file save process.

To cancel the acquire operation, override the LWia::AcquireCallBack function and return the ERROR_USER_ABORT error code.

L_WIA_SHOW_USER_INTERFACE Note

Microsoft's image acquisition dialog box sets its own initialization properties, such as the current intent (image type), selected area (left, top, width and height), paper source, duplex mode, etc.

If the L_WIA_SHOW_USER_INTERFACE flag is set, Microsoft's image acquisition dialog box overwrites some of the properties set/changed by any of the LWia::SetPropertyXXX or LWia::SetProperties functions.

To prevent overwriting, do not set the L_WIA_SHOW_USER_INTERFACE flag if any LWia::SetPropertyXXX or LWia::SetProperties functions need to be called.

Microsoft WIA Toolkit Limitation

The Microsoft WIA Toolkit has the following, known limitation:

A Win32 version application running on Windows VISTA 64-bit that calls [LWia:Acquire, specifying the pnFilesCount and pppszFilePaths parameters, fails to fill those two members with the required information.

Required DLLs and Libraries

See Also

Functions

Topics

Example

For an example, refer to LWia::IsAvailable.

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

LEADTOOLS WIA C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.