V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
aec4d
V2EX  ›  问与答

python twainmodule 设置A3

  •  
  •   aec4d · 2014-01-05 22:47:39 +08:00 · 2383 次点击
    这是一个创建于 3778 天前的主题,其中的信息可能已经有所发展或是发生改变。
    深夜求解答,使用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)
    也是失败的,真感觉有点奇怪,为啥有这个值,但是设置的时候又会提示超出范围呢
    第 1 条附言  ·  2014-01-09 18:57:54 +08:00
    ss.SetImageLayout((0.0, 0.0 ,11.0 ,17.0), 1, 1, 1)
    http://twainmodule.sourceforge.net/docs/ds.html
    完善的文档不好好看真该抽自己脸。。。
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4990 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 09:50 · PVG 17:50 · LAX 02:50 · JFK 05:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.