C#: Online Guide
How To: Twain SDK
Basic Acqusition
Basic Acqusition
  |  
Home ›› XImage.Twain ›› C# Twain: Basic Acqusition

C# TWAIN - Basic Image Acquisition Guide


C# Acquisition Class Object for Basic TWAIN Image Scanning Process




C# TWAIN Basic Image Acquisition Overview



Although our C# TWAIN image scanning library add-on offers developers the capacity to customize the TWAIN image acquisition process, we also allow programmers to conduct a system default scanning application if they just want achieve C# TWAIN basic image scanning process.


Related .net document control helps:
asp.net edit pdf image: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net dnn pdf editor: ASP.NET DNN PDF Editor Control: view, edit PDF files in Dotnetnuke application
asp.net open pdf password: ASP.NET PDF Password Edit Control: online add, remove, update PDF file open password using C#
asp.net mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
asp.net dnn document viewer: DNN Document Viewer Control: view, annotate, redact, convert documents in dotnetnuke ASP.NET
asp.net webforms document viewer: ASP.NET WebForms application document viewer control: view, annotate, redact, convert files online in ASP.NET
asp.net redact pdf: ASP.NET Redact PDF Document Control: redact, remove PDF text, images in web browser using C# ASP.NET




Preparation for C# TWAIN Image Acquisition



In this part, you will find the installation requirements of this C# TWAIN basic image acquisition component toolkit.


Install C# TWAIN Image Scanning Compact DLLs


C# developers can easily add basic TWAIN image scanning features to their imaging application by integrating following compact dlls, which are RasterEdge.Imaging.Basic.dll and RasterEdge.Imaging.TWAIN.dll, into the project references.


Obtain License Key of C# TWAIN Image Scanning SDK


A valid developing license key is needed if you want to use this C# TWAIN scanning control for basic image acquisition. After you get the license key of C# TWAIN image scanning add-on, you need to put it in the bin folder of your C# TWAIN imaging application, together with integrated C# TWAIN scanning dlls.


Configure System Environment for C# TWAIN Image Acquisition


To ensure the C# TWAIN image capturing library add-on can work successfully in your imaging application, you have to make sure you have installed .NET Framework 2.0 (or 3.0, 3.5, 4.0, 4.5), Microsoft Visual Studio 2005 (or VS 2008, VS 2010, VS 2012), TWAIN and at least one TWAIN compatible device.




C# TWAIN Acquisition Object and Event Introduction



In the process of C# TWAIN basic image acquisition, a programming class, namely, Acquisition object, and an event handler, namely, ImageAcquireEvent, will be used. The Acquisition object is the primary class in RasterEdge C#.NET TWAIN Scanning add-on, which contains various Device objects that control numerous properties of TWAIN device(s). After you create an Acquisition object, you need to add an event handler named ImageAcquiredEvent to the image capturing event. Once the image acquiring event is triggered, you can write your own C# programming code to process acquired image object.


Here we list the code for ImageAcquiredEvent:




public event ImageAcquireEventHandler ImageAcquired;





C# Demo Code for Basic Image Acquisition



In this part, we offer you a Visual C# .NET programming code, using which you can finish the basic TWAIN image acquisition process.




public void Scanning()
{
   Acquisition acq = new Acquisition();
   acq.ImageAcquired += new ImageAcquireEventHandler(acq_ImageAcquired1);
   acq.Aquire();
}

void acq_ImageAcquired1(object sender, ImageAcquiredEventArgs e)
{
   REImage myImage = REImage.FromBitmap(e.Image);
}