I am currently working with some OMR software that will take and scan sheets from a scanner, and then write their information to a text file. For getting available local scanners, I am using WIA; to get these scanners, I would use some bit of code like
public List<ScannerInfo> GetWiaDevices()
{
WIA.DeviceManager mgr = new WIA.DeviceManager();
List<ScannerInfo> retVal = new List<ScannerInfo>();
foreach (WIA.DeviceInfo info in mgr.DeviceInfos)
{
if (info.Type == WIA.WiaDeviceType.ScannerDeviceType)
{
foreach (WIA.Property p in info.Properties)
{
if (p.Name == "Name")
retVal.Add(new ScannerInfo(((WIA.IProperty)p).get_Value().ToString(), info.DeviceID));
}
}
}
return retVal;
}
Now, I am working with something that is technically a printer (and that Windows reads as a printer) -- the Konica Minolta Bizhub 282, I believe. Unfortunately, if (info.Type == WIA.WiaDeviceType.ScannerDeviceType)
doesn't recognize printers with built in scanners as scanners, so when I run this code checking for local scanners, the printer doesn't show up.
Is there a way to make printers with built-in scanners show up on the list, and furthermore, to make them usable as scanners in C#? Thanks for your time!