TWAIN scanning from C# using the csXImage ActiveX control

The ActiveX control csXImage includes a range of functions to acquire images from TWAIN compliant devices such as scanners and webcams.

This functionality is demonstrated with this simple C# application. The application is a single form which includes an instance of csXImage. When the project is run and the form fMain is loaded, the list of TWAIN devices available on the system is read by csXImage and used to populate a ComboBox. The user can then select a device from this list.

The device configuration (image size, resolution, pixel type) can either be set directly by the user or by using the default interface of the device. The image is then acquired using the Acquire button. There is also an option to save the image to disk.


To run this demo you need the csXImage trial ocx control installed on your system as well as MS Visual Studio.NET. The trial control and the example files are available below:

Download the trial csXImage control - csXImageTrial.exe (3 MB)

The demo C# Twain project - (193 KB)

Description of the sample C# Twain project.