python twainmodule 设置A3

2014-01-05 22:47:39 +08:00
 aec4d
深夜求解答,使用python的twain模块扫描A3,如何设置成A3输入?
官网http://twainmodule.sourceforge.net/docs/caps.html也有坑,比如介绍的以下一段
To set the current value of the capability, use the SetCapability method. This method take three parameters, the identity of the capabaility (CAP_*, ICAP_* or ACAP_*), the type of the value (as returned from GetCapabilityCurrent), and the new value.

>>> ss.GetCapabilityCurrent(twain.ICAP_IMAGEFILEFORMAT, TWTY_UINT16, TWFF_JFIF)

正确写法应该是ss.SetCapability(twain.ICAP_IMAGEFILEFORMAT, twain.TWTY_UINT16, twain.TWFF_JFIF)

我使用twain twacker查询和设置ICAP_SUPPORTEDSIZE结果如下
http://bcs.duapp.com/picstore/aMqibomfDN.png
http://bcs.duapp.com/picstore/txfl7TNTeV.png

当然是用ss.SetCapability(twain.ICAP_IMAGEFILEFORMAT, twain.TWTY_UINT16, twain.TWSS_A3)
也是失败的,真感觉有点奇怪,为啥有这个值,但是设置的时候又会提示超出范围呢
2384 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/95780

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX