C#: Online Guide
How To: Twain SDK
Convert Acquired Image to Other Image Formats
Convert Acquired Image to Other Image Formats
  |  
Home ›› XImage.Twain ›› C# Twain: Convert Acquired Image to Other Image Formats

C# TWAIN - Convert Image to Other Image Formats


C# Tutorial for Converting TWAIN Acquired Image to Other Image Formats




Overview of Converting TWAIN Scanned Image in C#



Using our C#.NET TWAIN Plug-In and .NET Image Conversion Control, users are able to convert image get from TWAIN acquisition to other image formats using C#.NET programming. TWAIN scanned image can be converted to all of the TWAIN device supported image formats. If your target image is not supported by the TWAIN device, you can use our API(s) to convert acquired image to various image formats supported by our .NET Image Libraries, such as BMP, PNG, TIFF, JPEG and SVG. You are also empowered to convert the acquired image to PDF document with the above Plug-in and Control in C#.NET application.


Related .net document control helps:
asp.net dicom document viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net document viewer c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
asp.net pdf document viewer: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
asp.net tiff viewer: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net word viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
asp.net document viewer: EdgeDoc:ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online in C#, VB.NET, AS...


To convert and save acquired image to other image formats in C#.NET, you need to add event handler to the "FileTranfer" event in your C# project.




Preparation for Converting TWAIN Acquired Image in C#



DLLs Used in Converting TWAIN Scanned Image to Other Formats in C#


  Besides the default file formats supported by your TWAIN compliant device, you may convert image get from TWAIN Scanning to other image formats (like PNG, BMP, TIFF) with RasterEdge image libraries, and then you need to add these dlls to your Visual C#.NET project references: RasterEdge.Imaging.Basic.dll, RasterEdge.Imaging.Processing.dll & RasterEdge.Imaging.TWAIN.dll.


  For users who want to convert TWAIN scanned image to PDF document in C#.NET application, you may need RasterEdge.Imaging.PDF.dll together with the above three dlls.


  If you want to process the acquired image to achieve a better result, you may need to locate these core dlls to your Visual C#.NET application in addition to the above dlls: RasterEdge.Imaging.Drawing.dll,  RasterEdge.Imaging.WebViewer.dll and RasterEdge.Imaging.Annotation.dll.


License for TWAIN Acquired Image Conversion to Other Formats in C#


The evaluation version of our C#.NET TWAIN Plug-In cannot be used in commercial applications and you need to purchase related license for commercial usage. For more detailed information on license purchasing, please go to RasterEdge purchasing page.


Environment for Running C#.NET TWAIN Scanned Image Conversion Control


Our C#.NET TWAIN Scanned Image Conversion Control is completely compatible with .NET Framework 2.0 or later versions. It can be used in your C#.NET project created in Visual Studio 2005, 2008, 2010 or 2012. To use this C#.NET control for converting TWAIN scanned image to other image and document formats, please check if TWAIN is installed in your system and whether there is a TWAIN compatible device.




Demo for Converting TWAIN Acquired Image to Other Formats in C#.NET Project



It is simple to convert image from TWAIN scanning to other image and document formats using a few lines of C# code. The following sample code can be used in your C#.NET project to convert TWAIN scanned image to PNG image format.




/// <summary>
/// Convert Scanned image with compression Scheme supported by RasterEdge.Imaging.
/// </summary>
public void ScanningImageToPNGFormat()
{
   Acquisition acq = new Acquisition();
   acq.FileTranfer += new EventHandler(OnFileTransfer2);
   acq.Aquire();
}


public void OnFileTransfer2(object sender, FileTransferEventArgs e)
{
   e.FileFormat = TwainFileFormat.PNG;
   e.FileName(@"C:\ScanningPNGs");
}