ntwain icon indicating copy to clipboard operation
ntwain copied to clipboard

How to keep the UI displayed

Open jueqing1015 opened this issue 4 years ago • 2 comments

_twain.CurrentSource.Enable(SourceEnableMode.ShowUI, true, this.Handle) After scanning one, the scanner interface will be closed automatically. Is there any way to keep it open because I want to scan continuously @soukoku @soukoku

jueqing1015 avatar Jun 19 '20 05:06 jueqing1015

Am also trying to figure this out. Did you have any luck figuring it out?

mikebm avatar Dec 05 '23 15:12 mikebm

I've figured it out. TransferLogic.cs This section of code -

        // some poorly written scanner drivers return failure on EndXfer so also check for pending count now.
        // this may break with other sources but we'll see
        if (//pending.Count == 0 && 
            session.State > 5)
        {
            session.ChangeState(5, true);
            session.DisableSource();
        }

You can comment out session.DisableSource();. It is currently designed to disable the source which closes the UI as soon as it finishes the transfer.

mikebm avatar Dec 05 '23 16:12 mikebm