L_WiaSetProperties

#include "ltwia.h"

L_LTWIA_API L_INT EXT_FUNCTION L_WiaSetProperties(hSession, pItem, pProperties, pfnCallBack, pUserData)

Sets a list of all properties available through the LWIAPROPERTIES structure into the WIA device's item passed through the pItem parameter.

Parameters

HWIASESSION hSession

Handle to an existing WIA session. This handle is obtained by calling the L_WiaInitSession function.

L_VOID* pItem

Valid pointer to a type IWiaItem or IWiaItem2 object (IWiaItem if using WIA Version 1.0; IWiaItem2 if using WIA Version 2.0), which represents the item that is having its properties set.

Retrieve this parameter by either calling the L_WiaGetRootItem function to get a pointer to the device's root item or by enumerating the child items of the device through a call to L_WiaEnumChildItems.

pLWIAPROPERTIES pProperties

Pointer to a structure of type LWIAPROPERTIES retrieved through the call to the L_WiaGetProperties function.

LWIASETPROPERTIESCALLBACK pfnCallBack

Optional callback function. It is called as each property is set. It lets the user know if an error occurred during the set operation and lets the user abort or retry by returning WIA_ABORT or WIA_RETRY.

If you do not provide a callback function, use NULL as the value of this parameter. No error reporting will occur.

If you do provide a callback function, use the function pointer as the value of this parameter.

The callback function must adhere to the function prototype described in LWIASETPROPERTIESCALLBACK function.

L_VOID * pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

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

Comments

This feature is available in version 16 or higher.

The function can set the values of the properties to the values specified in the LWIAPROPERTIES structure into the WIA device's item passed through the pItem parameter.

✎ NOTE

If the user set the L_WIA_SHOW_USER_INTERFACE flag, then he should be aware of the following point:

Some of the these properties will be overwritten by the Microsoft image acquisition dialog box, like the current intent (image type), selected area (left, top, width and height), paper source and duplex mode, etc.

So if the user wants to keep his changed properties then he should not set this flag to suppress the manufacturer's image acquisition dialog and acquire directly from the specified source item.

✎ NOTE

Through our test we have found the following limitation related to the Microsoft WIA toolkit: On some drivers, while using WIA 2.0, if you want to change the Image Data Type property (WIA_IPA_DATATYPE) to a custom setting then you have to set the WIA_IPS_CUR_INTENT property value to WIA_INTENT_NONE.

Required DLLs and Libraries

Platforms

LEADTOOLS WIA supports both 32-bit and 64-bit image acquisition for both WIA 1.0 (XP and earlier) and WIA 2.0 (VISTA and later).

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 API Help