I tried the solution suggested in this thread. HOW TO RETRIEVE INSTALLED SCANNER
I did the following:
Next, I added and debugged the following code:
WIA.DeviceManager manager = new WIA.DeviceManagerClass();
WIA.DeviceManagerClass managerClass = new WIA.DeviceManagerClass();
string wdeviceName = "";
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
if (info.Type == WIA.WiaDeviceType.ScannerDeviceType)
{
foreach (WIA.Property p in info.Properties)
{
if (p.Name == "Name")
{
wdeviceName = ((WIA.IProperty)p).get_Value().ToString();
Console.WriteLine(wdeviceName);
}
}
}
}
However, the manager.DeviceInfos is always empty. I have 2 scanners attached, one of them shows in Control Panel->Scanners and Cameras, one doesn't, and both show under "Imaging Devices" in Device manager.
At this point, the only idea I have is that the scanner drivers just do not support WIA. As long as I have no way to check if this is true or not, I'll have to stick to the yesterday's solution.
by Evgeny. Also posted on my website
No comments:
Post a Comment