Using Twain Module in Python

2019-07-14 07:20发布

问题:

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 :

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