3
我正在用C#開發應用程序以使用WIA 2.0庫。目前我可以使用大部分功能,例如ADF(自動文檔進紙器),濾鏡等等。WIA 2.0雙面打印屬性
現在,我需要使用我的掃描儀(fujitsu)的雙面打印器。
我試圖將WIA_DPS_DOCUMENT_HANDLING_SELECT掃描儀屬性設置爲DUPLEX值。請參見下面的代碼:
try
{
bool hasMorePages = false;
//determine if there are any more pages waiting
Property documentHandlingSelect = null;
Property documentHandlingStatus = null;
foreach (Property prop in WiaDev.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;
}
object obj = new object();
obj = (WIA_DPS_DOCUMENT_HANDLING_SELECT.DUPLEX);
documentHandlingSelect.set_Value(ref obj);
if (documentHandlingSelect != null) //may not exist on flatbed scanner but required for feeder
{
//check for document feeder
if ((Convert.ToUInt32(documentHandlingSelect.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER) != 0)
{
hasMorePages = ((Convert.ToUInt32(documentHandlingStatus.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_STATUS.FEED_READY) != 0);
if (hasMorePages)
{
// set the property to use FEEDER and DUPLEX (this result in the value of 5 in the property)
object obj = new object();
obj = (WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER | WIA_DPS_DOCUMENT_HANDLING_SELECT.DUPLEX);
documentHandlingSelect.set_Value(ref obj);
}
}
}
return hasMorePages;
此代碼編譯好了,但我沒能得到兩個圖像,當我執行這條線。它僅檢索前:
imgFile = (ImageFile)wiaCommonDialog.ShowTransfer(item, format.Guid.ToString("B")/* wiaFormatJPEG*/, false);
我讀到許多主題,該文檔還,有可能讓孩子的物體形成掃描儀上的項目,但只有一個在此集合中的項目。
請有人幫助我!
感謝