Tuesday, February 01, 2005

Twain class for .NET

Hello all,

For my first posting, I'll put up a .NET class I just wrote that encapsulates the TWAIN functionality in Windows. I used a LOT of the work of someone that he posted on the codeproject.com.

The full source can be found here.
Have fun with it. Basically, instantiate the Twain object, call Init, then use Select to choose which TWAIN object you want to use. Make sure your application handles the Twain.ScanEvent event. This event is raised when a scan happens. Call the Acquire method to start that process. Once the inside the ScanEvent, you can call the TransferPictures and receive an array of System.Drawing.Image objects corresponding to the pics transferred from the source.

Laters....

No comments: