ciansoft.com
Home
Products
Contact us
Site Map
Acquiring multiple images from a scanner in VB.NET

A sample application using TwainControlX

This example shows how to acquire a series of images from a TWAIN device, typically a scanner equipped with an Automatic Document Feeder (ADF).

To use this demo, you will need to download two files:

Trial version of the ActiveX control TwainControlX. (788kB)

Zip file of VB.NET demo project. (27kB)

Install TwainControlX, then extract the VB.NET demo files from TCXMult1VBNET.zip, keeping the same directory structure. Start VB.NET, and open the project in solution file 'TCX_Mult1_VBNET\TCX_Mult1_VBNET.sln'.

Run the project and click the Start button. A list of the TWAIN devices installed on your system will be displayed. Select one of the devices and up to 5 images will be captured and saved to disk as files "C:\Image1.bmp" etc.

The user interface is disabled by the command 'AxTwain1.UseInterface = False'. The number of images to be acquired is set by the command 'AxTwain1.ImagesToRead = 5'. Either of these settings can be modified if required.

After each image is acquired, the code in 'AxTwain1_OnAcquire' will run. This saves the image to disk and displays it in a PictureBox.

Default settings for the image size and resolution will be used. This usually means that the image is too big to display in the PictureBox, so only the top left portion of the image will be seen on screen. The whole image will be saved to file.

Scanning will stop either when 5 images have been read, or when the ADF is empty.

User Manual - FAQ - Purchase TwainControlX