Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
Managing WIA Sources
After a handle to a WIA session has been established, the WIA source to use for acquiring images should be selected. WIA does not include a default device selection feature, so it is important to select a device. Use the L_WiaEnumDevicesLWia::EnumDevices function to determine the WIA sources available on the system. This function enumerates all available WIA sources and calls the LWIAENUMDEVICESCALLBACKLWia::EnumDevicesCallBack callback function for each WIA source found, retrieving its ID, name and description.
LEADTOOLS WIA offers two functions for selecting the WIA source to use for acquiring images:
L_WiaSelectDeviceDlgLWia::SelectDeviceDlg. Displays a dialog that lists all available sources installed on the system in order for the user to select a device.
L_WiaSelectDeviceLWia::SelectDevice. Selects the WIA device without displaying the Select Device dialog. To do this, enumerate the WIA devices by calling the L_WiaEnumDevicesLWia::EnumDevices function. Then use it to keep a list of all received device ID’s. Then call the L_WiaSelectDeviceLWia::SelectDevice function using the device ID for the device to be selected.
Once a device is selected, use the L_WiaGetSelectedDeviceLWia::GetSelectedDevice function to get the selected device ID as string.
Also you can use the L_WiaGetSelectedDeviceTypeLWia::GetSelectedDeviceType function to determine the type of the device currently selected at the runtime to check whether it’s a scanner, camera or streaming video device.