Guide for VB.NET
Core Document Formats
Additional Features
Console Based Scanning

VB.NET TWAIN - Image Scanning in Console Project

Demo VB.NET Code for TWAIN Image Capturing in Console Application

VB.NET
Home > .NET Imaging SDK > VB.NET > TWAIN: Console Based Scanning
To get started with DocImage SDK for .NET, you are supposed to read VB.NET Imaging: Get Started first!

In some cases, VB.NET developers may be asked to conduct TWAIN image scanning function in command-line driven application other than graphical interface (GUI) application. Under this situation, a fully-featured and effective .NET TWAIN scanning solution will be a great choice. This VB.NET TWAIN console image scanning tutorial page will help developers answer following questions.
Related .net document control helps:
asp.net open word document in browser: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
asp.net document viewer control: EdgeDoc:ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online in C#, VB.NET, AS...
asp.net pdf editor control: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net excel view: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
asp.net mvc text file viewer: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net edit pdf text color: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
  • What VB.NET demo code can I use to conduct image scanning in console application?
  • What is the difference between TWAIN console scanning application and TWAIN WinForms scanning project?
  • Why do I need to choose RasterEdge VB.NET TWAIN console scanning control add-on?
VB.NET Demo Code
With the purpose to help VB.NET developers have a better control of this VB.NET TWAIN console scanning control, we here specifically offer a snippet of VB.NET demo code. If you have any problem in the process of testing this VB.NET TWAIN scanning code in command-line application, please feel free to contact us. Before using following sample VB.NET code for TWAIN image scanning, please make sure you have obtain valid developer license key and that you have installed TWAIN and a TWAIN-compatible device.
Private Shared Sub Main(args As String())
Dim acquisition As New Acquisition()
AddEvents(acquisition)
count = 0
Dim devices As DeviceCollection = acquisition.Devices
Dim selected As Device = SelectDevice(devices)
selected.HideInterface = True
selected.ModalAcquire = True
Console.Out.WriteLine("---Beginning Scan---")
selected.Acquire()
Console.Out.WriteLine("---Ending Scan---" & vbLf & " Press Enter To Quit")
Console.[In].Peek()
End Sub

Private Shared Sub AddEvents(acquisition As Acquisition)
acquisition.ImageAcquired += New ImageAcquiredEventHandler(AddressOf acquisition_ImageAcquired)
acquisition.AcquireFinished += New EventHandler(AddressOf acquisition_AcquireFinished1)
acquisition.AcquireCanceled += New EventHandler(AddressOf acquisition_AcquireCanceled1)
End Sub

Private Shared Sub acquisition_AcquireCanceled1(sender As Object, e As EventArgs)
Console.Out.WriteLine("Acqusition Canceled")
End Sub

Private Shared Sub acquisition_AcquireFinished1(sender As Object, e As EventArgs)
Console.Out.WriteLine("Acquisition Finished")
End Sub

Shared count As Integer
Private Shared Sub acquisition_ImageAcquired(sender As Object, e As ImageAcquiredEventArgs)
Dim filename As String = "out" & System.Math.Max(System.Threading.Interlocked.Increment(count),count - 1) & ".tif"
e.Image.Save(filename, ImageFormat.Tiff)
Console.Out.WriteLine("Frame " & count & " Acquired. Saved At: " & filename)
End Sub

Private Shared Function SelectDevice(devices As DeviceCollection) As Device
'TODO: Implement a Methodology for selecting a device
End Function
TWAIN Console & WinForms Scanning
This section mainly makes an explanation of the differences between VB.NET TWAIN console scanning application and TWAIN Windows Forms scanning project. The image scanning process conducted in console application is similar to that conducted in Windows Forms project. But there are still differences existing in those two TWAIN scanning applications.
  • First, there is no SelectSourceDialog in VB.NET TWAIN console scanning application. Thus, developers need to implement some other methods for selecting a TWAIN-compatible device.
  • Second, when you conduct TWAIN image scanning in console application, you have to use VB.NET code to stop the application after the image is acquired.
Why to Choose
RasterEdge VB.NET TWAIN console scanning library SDK is an efficient TWAIN scanning .NET solution with advanced and fully-featured functions. Here we will illustrate the benefits of this VB.NET TWAIN console scanning control add-on.

Professional VB.NET TWAIN Console Scanning Control with Reasonable Price

Programmed in 100% managed C# code, this VB.NET TWAIN console scanning add-on has been used by numerous developers based on its full TWAIN scanning functions, flexible developer licenses and extremely reasonable price.

Support both Console and GUI Application Using VB.NET Code

Different from most TWAIN console driven scanning controls, this VB.NET TWAIN command-line driven library SDK can not only be used in console applications but also be applied to GUI (Graphical User Interface) applications.

Suitable for Multiple .NET Framework Applications

You can successfully make this VB.NET TWAN scanning control work at your console application if you have installed .NET Framework 2.0, 3.0, 3.5, 4.0 or 4.5.

Capture Image Quickly and Completely Using VB.NET Code

Using this VB.NET TWAIN console scanning control add-on, developers can barely meet the situation where the TWAIN scanning utility fails to acquire image.

Own Comprehensive VB.NET TWAIN Image Scanning Functions

Apart from the basic image capturing function, this VB.NET TWAIN console scanning library add-on also owns the abilities to convert scanned image to other document formats and achieve duplex & automatic scanning and stamp string text on captured image.

Own Compatibility with both Visual Basic .NET and Visual C# Code

This VB.NET TWAIN command-line driven scanning control add-on supports scanning image in console application using C# code and VB.NET code.
If you want to see other useful examples of RasterEdge VB.NET TWAIN image scanning SDK, like how to scan multiple pages to one PDF or TIFF file using VB.NET code, just follow the link directly. If you want to have a detailed understanding of the TWAIN image capturing process, please follow the link to VB.NET TWAIN scanning tutorial page where all supported VB.NET TWAIN scanning APIs are listed.


Recommend this to Google+


RasterEdge.com is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster Edge.com