I would like to use a scanner by loading documents from the ADF, but I have not found anything to help me set the source as ADF and not flat. I have made a lot of attempts, I think it is necessary to set the Properties, I tried to do it with this code, but it does not read any of the settings made.
WIA.CommonDialog _dialog = new CommonDialog();
WIA.Device _scanner = _dialog.ShowSelectDevice(WIA.WiaDeviceType.ScannerDeviceType, false, false);
foreach (Property item in _scanner.Items[1].Properties)
{
switch (item.PropertyID)
{
case 6146: //4 is Black-white,gray is 2, color 1
SetProperty(item, 2);
break;
case 6147: //dots per inch/horizontal
SetProperty(item, 100);
break;
case 6148: //dots per inch/vertical
SetProperty(item, 100);
break;
case 6149: //x point where to start scan
SetProperty(item, 0);
break;
case 6150: //y-point where to start scan
SetProperty(item, 0);
break;
case 6151: //horizontal exent
SetProperty(item, (int)(8.5 * 100));
break;
case 6152: //vertical extent
SetProperty(item, 11 * 100);
break;
}
}
CommonDialog oDialog = new CommonDialog();
oDialog.ShowAcquisitionWizard(_scanner);
private void SetProperty(Property property, int value)
{
IProperty x = (IProperty)property;
Object val = value;
x.set_Value(ref val);
}