python调用扫描仪设备,在Python中使用Twain模块

在64位Windows和Python环境下,使用Twain模块连接扫描仪时遇到问题。DSM(Data Source Manager)的32位和64位版本寻找驱动程序的路径不同。为解决空窗口问题,需要检查安装的驱动程序版本(32位或64位),并使用Dependency Walker工具快速定位依赖问题。详细解决方案可在TWAIN官方文档第12章找到。
摘要由CSDN通过智能技术生成

I have 64 bit Windows and 64 bit Python . In the twain docs said : supports only 32 bit . I have used twain data source to install my 64 bit machine and used this code to connect scanner device:

import twain

sm = twain.SourceManager(0)

ss = sm.OpenSource()

ss.RequestAcquire(0,0)

rv = ss.XferImageNatively()

if rv:

(handle, count) = rv

twain.DIBToBMFile(handle, 'image.bmp')

When I run the app. a windows opens like :

36203fee31a3665594af8bf0e4994fd8.png

so why this window is empty . The scanner device will show in this window ?

解决方案

The driver files for a 32 bit driver will be placed twain_32 folder and 64 bit driver files under the twain_64 folder. The twain DS

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值