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_WiaEnumDevices function to determine the WIA sources available on the system. This function enumerates all available WIA sources and calls the LWIAENUMDEVICESCALLBACK 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_WiaSelectDeviceDlg. Displays a dialog that lists all available sources installed on the system in order for the user to select a device.
L_WiaSelectDevice. Selects the WIA device without displaying the Select Device dialog. To do this, enumerate the WIA devices by calling the L_WiaEnumDevices function. Then use it to keep a list of all received device ID’s. Then call the L_WiaSelectDevice function using the device ID for the device to be selected.
Once a device is selected, use the L_WiaGetSelectedDevice function to get the selected device ID as string.
Also you can use the L_WiaGetSelectedDeviceType 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.