C#: Online Guide
How To: Twain SDK
Quick to Start
  |  
Home ›› XImage.Twain ›› C# Twain: Quick to Start

C# TWAIN - Quick to Start Using XImage.Twain SDK


To Have a Quick Evaluation of XImage.Twain Scanning in Visual C# Windows Application




This page is mainly designed for C# users have a quick evaluation of RasterEdge XImage.Twain scanning function, Please refer to the guide below to come into operation.


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 webforms pdf editor: ASP.NET WebForms PDF Editor: create, view, edit, annotate, redact PDF file in ASP.NET WebForms application
asp.net sharepoint pdf editor: ASP.NET SharePoint PDF Editor Control: view, edit, annotate, redact PDF document in SharePoint sites
asp.net edit pdf page: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
asp.net open pdf password: ASP.NET PDF Password Edit Control: online add, remove, update PDF file open password using C#
asp.net redact pdf: ASP.NET Redact PDF Document Control: redact, remove PDF text, images in web browser using C# ASP.NET
asp.net convert pdf: ASP.NET Convert PDF Control: Convert, export PDF to Word, HTML, Tiff files in C# ASP.NET




Create a C# Windows Application



Open Visual Studio and click "New" from toolbar. Note, Visual Studio 2005 and above versions are available;


Choose "C# Language" and "Windows Application" respectively to create a project.




Automatic Scanning for C# TWAIN Capturing Application in C#.NET



By following steps below, your C# project are able to read EAN-13 from PDF document.


Add necessary XImage.Raster DLL libraries into your created C# application as references.


  RasterEdge.XImage.BarcodeScanner.dll


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.XDoc.PDF.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.Imaging.WinformsControl.Twain.dll


Use namespaces:


  RasterEdge.Imaging.Basic.Core;


  RasterEdge.Imaging.WinformsControl.Twain;


  RasterEdge.XImage.BarcodeScanner;


  RasterEdge.XImage.Raster;


Copy of the following C# sample code to your application.




public void AutomaticScanning(Device device)
{
   device.AutoScan = true;

   acquisition.ImageAcquired += new ImageAcquiredEventHandler(acquisition_ImageAcquired2);

   acquisition.AcquireFinished += new EventHandler(acquisition_AcquireFinished);

   acquisition.AcquireCanceled += new EventHandler(acquisition_AcquireCanceled);

   // start an auto capture to capture 10 image.time gap between every two captures is 1 second.
   device.StartAutomaticCapture(@"c:\CapturedImage\", 1, 1, 10);
}

static void acquisition_AcquireCanceled(object sender, EventArgs e)
{
   Console.Out.WriteLine("Acqusition Canceled");
}

static void acquisition_AcquireFinished(object sender, EventArgs e)
{
   Console.Out.WriteLine("Acquisition Finished");
}

static void acquisition_ImageAcquired2(object sender, ImageAcquiredEventArgs e)
{
   //do something here.
}