How can I incrementally scan a document on Windows, from C#, while getting callbacks to show pieces of the image as they come in, and update my own custom progress UI?
It looks like the scanner API options include:
- WIA, WIA Script Automation (windows)
- TWAIN (windows, linux)
- ImageKit and ImageCaptureCore (MacOS)
- SANE (linux)
- ISIS (windows, expensive commercial).
My attempt on WIA Script Automation:
I have a simple C# application which uses Windows WIA Script Automation to scan a document. (see the code on github) However, during the Scan the UI is hijacked by a popup progress dialog.
The current code scans using the WIA Scripting CommonDialog.showTransfer
(see here), which shows a popup progress bar dialog. I understand I can instead use Item.Transfer
, however, it blocks for the entire duration and offers no callback so I can update my own custom progress UI (or cancel the transfer).
Is there any way to do a non-blocking scan with WIA, or to get progress callbacks?
Do I have to use TWAIN?