V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
aec4d
V2EX  ›  问与答

python twainmodule 设置A3

  •  
  •   aec4d · Jan 5, 2014 · 2762 views
    This topic created in 4498 days ago, the information mentioned may be changed or developed.
    深夜求解答,使用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)
    也是失败的,真感觉有点奇怪,为啥有这个值,但是设置的时候又会提示超出范围呢
    Supplement 1  ·  Jan 9, 2014
    ss.SetImageLayout((0.0, 0.0 ,11.0 ,17.0), 1, 1, 1)
    http://twainmodule.sourceforge.net/docs/ds.html
    完善的文档不好好看真该抽自己脸。。。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2559 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:32 · PVG 20:32 · LAX 05:32 · JFK 08:32
    ♥ Do have faith in what you're doing.