WIA 2.0双面扫描 [英] WIA 2.0 Duplex scanning

查看:352
本文介绍了WIA 2.0双面扫描的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自Vista以来,Windows随WIA 2.0(wiaaut.dll)一起提供。
根据下面的知识库文章以及我在各种论坛上的许多发现,使用WIA 2.0不再可能进行双面扫描。但是,本文提到使用本机WIA 2.0,这将使双面扫描成为可能。
https://support.microsoft.com/en-us/kb/ 2709992

Since Vista, Windows is shipped with WIA 2.0 (wiaaut.dll). According to the following KB article and many of my findings on various forums, duplex scanning is no longer possible using WIA 2.0. Yet, the article mentions the use of native WIA 2.0, what would make duplex scanning possible. (https://support.microsoft.com/en-us/kb/2709992)

根据WIA 2.0文档( https://msdn.microsoft.com/zh-CN/library/windows/desktop/ms630196(v = vs.85).aspx ),则可以进行双向扫描,但可以使用新的WIA_IPS_DOCUMENT_HANDLING_SELECT(3088)属性。

According to the WIA 2.0 documentation (https://msdn.microsoft.com/en-us/library/windows/desktop/ms630196(v=vs.85).aspx), duplex scanning is possible but using the new WIA_IPS_DOCUMENT_HANDLING_SELECT (3088) property.

我的问题是:


  • 我不知道如何使用本机WIA,我怀疑在使用C#时根本不可能。

  • 我找不到设置方法。新的WIA_IPS_DOCUMENT_HANDLING_SELECT属性,因为该属性在我的wiaDevice属性中不存在。根据WiaDef.h,其财产ID仍为3088,唯一可能的值为0x400(1024)。

如果有人可以帮助您我(我想还有很多其他人)对此表示感谢,

If anyone could help me (and I think many others) out on this, it would be much appreciated!

问候,

M。

推荐答案

经过几个小时的搜索,我在以下帖子中找到了线索。
https://stackoverflow.com/a/7580686/3641369

After a few more hours of searching I found a clue in the following post. https://stackoverflow.com/a/7580686/3641369

当我使用单程双面扫描器时,正面和背面都同时扫描。通过将设备属性(设备属性,不是项目属性)设置为Document_Handling_Select为5(Feeder + Duplex),并将Pages设置为1,并调用传输方法2次,我终于得到了字体和扫描的背面。

As I used a one-pass duplex scanner, both front and back sides where scanned at the same time. By setting the device properties (device properties, not item properties) Document_Handling_Select to 5 (Feeder + Duplex) and Pages to 1 and calling the transfer method 2 times, I finally got the font and back side of the scan.

设置wiaDev.Properties [文档处理选择] = 5指定使用进纸器和扫描双面打印。

Setting wiaDev.Properties["Document Handling Select"] = 5 specifies the use of the feeder and scanning duplex.

设置wiaDev .Properties [ Pages] = 1表示扫描程序应在内存中保留1页,这样可以在1次扫描过程中将页面的正面和背面都保留在内存中。

Setting wiaDev.Properties["Pages"] = 1 specifies that the scanner should keep 1 page in memory, this allowing to keep both front side and back side of the page in memory during 1 scan pass.

if (duplex)
{
     wiaDev.Properties["Document Handling Select"].set_Value(5);
     wiaDev.Properties["Pages"].set_Value(1);
} 

获取Wia项目并设置颜色和dpi等项目属性。

Getting the Wia item and setting item properties such as color and dpi.

var item = wiaDev.Items[1];
item.Properties["6146"].set_Value((int)clr);
item.Properties["6147"].set_Value(dpi);
item.Properties["6148"].set_Value(dpi);

然后调用传输方法两次将返回两个不同的图像

Then calling the transfer method twice returns two different images

var img = (ImageFile)wiaCommonDialog.ShowTransfer(item, FormatID.wiaFormatJPEG);

ImageFile imgduplex = null;
if(duplex)
   imgduplex = (ImageFile)wiaCommonDialog.ShowTransfer(item, FormatID.wiaFormatJPEG);

希望这对某人有帮助!

这篇关于WIA 2.0双面扫描的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆