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:
c# asp.net document viewer: ASP.NET Document Viewer Control in C#: View, Annotate, Redact web document files in ASP.NET using C#
asp.net document viewer in c#: EdgeDoc ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online using ASP.NET Web Con...
c# asp.net iis document viewer: C# HTML5 Viewer: Deployment on IIS
asp.net edit pdf text using c#: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
c# asp.net powerpoint document viewer: ASP.NET PowerPoint Document Viewer Control: view pptx files online in C# using ASP.NET
c# asp.net tiff document viewer: ASP.NET Tiff Document Viewer: view, annotate Tiff files in HTML using C# Control
asp.net pdf file permission using c#: ASP.NET PDF File Permission Control: apply, remove PDF file permission settings in C#


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");
}