我正在編寫一個程序,通過WIA與網絡掃描儀一起工作。 當只掃描一頁時,一切正常。當我打開進紙器:WIA +網絡掃描儀,adf = 1頁
foreach (WIA.Property deviceProperty in wia.Properties)
{
if (deviceProperty.Name == "Document Handling Select")
{
int value = duplex ? 0x004 : 0x001;
deviceProperty.set_Value(value);
}
}
程序接收掃描,仍有在饋線文檔和COM錯誤脫落(掃描儀繼續掃描)信號。 下面的代碼檢查頁進紙器:
//determine if there are any more pages waiting
Property documentHandlingSelect = null;
Property documentHandlingStatus = null;
foreach (Property prop in wia.Properties)
{
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_SELECT)
documentHandlingSelect = prop;
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_STATUS)
documentHandlingStatus = prop;
}
if ((Convert.ToUInt32(documentHandlingSelect.get_Value()) & 0x00000001) != 0)
{
return ((Convert.ToUInt32(documentHandlingStatus.get_Value()) & 0x00000001) != 0);
}
return false;
獲取圖片代碼:
imgFile = (ImageFile)WiaCommonDialog.ShowTransfer(item, wiaFormatJPEG, false);
可惜找不到使用WIA WSD的例子。也許有一些設置可以通過WSD獲取多個圖像。
我也有[相同的問題](http://stackoverflow.com/questions/27473142/cannot-read-second-page-scanned-via-adf/31908751#31908751),我通過安裝製造商的驅動程序解決。 – 2015-08-09 21:07:21