Create Windows TIFF Viewer in C#.NET

How to Create Windows TIFF Viewer with C# Code in An Easy Way
It is easy to create Windows-based Viewer for Tiff in C#.NET by using this C# Windows Tiff Viewer Library. Users are able to create and modify your Windows Tiff Viewer in C# class applications. Specific operation steps are shown on this user guide page. We have listed .NET environments and detailed operation steps for creating C# Windows Tiff Viewer. We have also explained the reasons for choosing our C# Windows Tiff Viewer Library.
In addition to providing the introduction of creating Windows-based Viewer for Tiff in C#.NET, in fact, we have also written tutorials for generating Web-based and Windows-based Viewer for Tiff in VB programming respectively and VB.NET programmers may acquire some useful information from the two tutorials.
.NET Environments for Creating C# Windows TIFF Viewer
This C# Windows Tiff Viewer SDK supports creating Windows-based Viewer for Tiff in .NET environments. Here is a list of required .NET environments. You have to make sure that you have installed these items in order to successfully make use of our C# Windows Tiff Viewer SDK.
  • For operating systems, one of these is available, Windows 2000, Windows XP, Windows Vista, Windows 7 and Windows Server 2000 / 2003 / 2008.
  • Visual Studio 2005 or later versions are suitable.
  • .NET Framework 2.0, 3.0, 3.5 or 4.0 should be installed.
Create Windows TIFF Viewer with C# Demo Code
Developers can follow procedures below to smoothly create Windows-based Viewer for Tiff in C #programming. With this Windows Tiff Viewer, developers are able to view, save and print Tiff document in Visual C# implementations. Tiff document can be customized according to your own needs.
  • Download and unzip our C#.NET Windows Tiff Viewer Evaluation package.
  • Run your Visual Studio and create a new Windows Application project in C# language.
  • Right click your project item and add reference from the unzipped package (all dlls under "Bin" folder) to your project.
  • Add "Yiigo.Imaging.WindowsViewer.dll" to your Visual Studio "Toolbox" and you can see "YGWindowsViewer".
  • Use the following C# demo code to create Windows Tiff Viewer in C#.NET.
  • Run your Windows Application project to check the outcome.
     using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using System;
using System.Windows;
using Yiigo.Imaging.WindowsControl;
using Yiigo.Imaging.Tiff.WindowsControl;

namespace MultiPageTiff
{
public class TiffViewer
{

public int GetNumberOfPages(string FileName)
{
Image image = Image.FromFile(FileName);
Guid ID = image.FrameDimensionsList[0];
FrameDimension fd = new FrameDimension(ID);
return image.GetFrameCount(fd);
}

public Image GetSpecificPage(string FileName, int iPageNumber)
{
Image image = Image.FromFile(FileName);
MemoryStream ms = null;
Image returnImage = Image.FromFile(FileName);

try
{
ms = new MemoryStream();
Guid ID = image.FrameDimensionsList[0];
FrameDimension fd = new FrameDimension(ID);

image.SelectActiveFrame(fd, iPageNumber);
image.Save(ms, ImageFormat.Bmp);
returnImage = Image.FromStream(ms);
return returnImage;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString(), "Error");
return null;
}
finally
{
ms.Close();
}
}

public void SetTIFFCompression(string FileName, double QualityPercentage)
{
Bitmap bm = (Bitmap)Image.FromFile(FileName);
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
ImageCodecInfo ici = null;

foreach (ImageCodecInfo codec in codecs)
{
if (codec.MimeType == "image/tiff")
ici = codec;
}

EncoderParameters ep = new EncoderParameters();
ep.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, (long)QualityPercentage);
string newFileName = FileName.ToLower().Replace(".tif", "_Quality_" + QualityPercentage + "%.tif");
bm.Save(newFileName, ici, ep);
}

}
}
Reasons for Selecting Our C# Windows TIFF Viewer
C#.NET Windows Tiff Viewer is often used to view, load, zoom and rotate Tiff files in C# programming. Our C#.NET Windows Tiff Viewer SDK is a mature and professional component for creating online Windows Tiff Viewer using C# code. Our C#.NET Windows Tiff Viewer SDK is the preferred one for many developers due to the following reasons.
  • It supports various styles of Tiff encodings so as to reduce restrictions on C# Windows program Tiff files.
  • It opens single-page or multi-page Tiff files and displays them in an easily viewable format.
  • It also supports many widespread graphic file formats in C# Windows project, like JPEG, PNG, BMP and so on.
  • It seamlessly integrates with other Yiigo image SDKs, offering more Tiff processing functions.
  • It enables Tiff documents to be viewed in almost all modern browser environments.
  • It allows for making annotation and creating watermark on C# Windows project Tiff documents.
  • It requires no additional plug-in installation for viewing Tiff files on Windows application.
  • It adds high speed Tiff document viewing features to your C#.NET Windows applications.
C# Web Tiff Viewer is also widely used in .NET applications. If you has a demand of creating Web Tiff Viewer in C# class, you may need a our C#.NET Web Tiff Viewer SDK. If you do not have better knowledge of creating Web-based Viewer for Tiff using C# code, you can turn to our online tutorial for help. Besides, Tiff files can be converted to many other image formats (including PDF, JEPG, HTML, etc.) with our advanced C# Tiff Conversion Library.
Products
Other Plugins
Image Viewer CoreBarcode PluginPDF Read & WriteTesseract OCR PluginForm Processing PluginJBIG2 CodecJPEG2000 CodecISIS ScannerTwain ScannerDICOM ReaderCAD Scanner