delphi - DelphiTwain : How to know that scanning from feeder is finished -
i using tdelphitwain component scanning. when start scanning feeder, scanning performed assynchronously , event ontwainacquire triggered when new image available processing. can not find how check scanning of douments finished. when feeder tray empty, scanning stops , if put new papers feeder not process it. need know finished , can process received images. can check feeder empty, can easy miss (with check) moment when tray empty, app think new images coming, don't. supposed there should kind of events such task (startsession/stopsession), can't find it.
in code looks this:
procedure tformdemo.formshow(sender: tobject); begin twain := ttwainscanner.create; twain.ontwainacquire := acquire; twain.source[selecteddevice].setfeederenabled(true); twain.source[selecteddevice].enabled := true; // start end; procedure tformdemo.acquire(sender: tobject; const index: integer; bitmap: tbitmap; var cancel: boolean); begin // processing cancel := false; end; i catch onacquireprogress event progress of current image scanning , doesn't know when scanning stopped.
update: found solution. when ttwainsource finishes processing of twain events sets enabled=false ttwainsource. unfortunately inside of ontwainacquire still true, became false later , there no event can check it. workaround can check timer.
i used delphitwain here http://www.kluug.net/delphitwain.php author agreed add new event, updated version of library problem solved.
Comments
Post a Comment