Search code examples
.netvb.nettwainimage-scanner

Can one listen a twain (Maybe WIA) scanner?


I am evaluating VintaSoft .net control and Atalasoft DotTwain Image Capture. And I am very but very lost with the most of the definitions and keywords.

So I am asking this because I think I am in Lala land. Is it possible to listen or have the scanner tell my app that there is a scanned image and I can process it?

The idea is to have a winservice that is waiting for the scanner to scan something and when that happens process the image.


Solution

  • I have only worked with the native interfaces to TWAIN and WIA, so I can't vouch for these other layers on top of them. However, with regards to TWAIN, some mechanisms do exist that allow an application to be notified to capture data. I believe this is handled with STI.dll, an older library that is available on Windows 2000+. Look up StiCreateInstance for more info.

    If you choose to go the WIA route, it is much simpler. You can register to recieve events, such as a 'scan' button or 'image created' event. Then all you need to do is handle those events to get the image. The toughest part of that is finding hardware that implements the features you want.

    Microsoft has a WIA automation library that makes many of these tasks much simpler. It can be used by scripting languages.