Guide for C#
Core Document Formats
Additional Features

C# Imaging - Create Windows Image Viewer in C#

Online C#.NET Tutorial for Creating Windows Document Image Viewer

Visual C#
Home > .NET Imaging SDK > C# > Create Windows Viewer
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!

C# Windows Image Viewer SDK Overview

Like C#.NET Web Doc Image Viewer, this professional and mature Windows Document & Image Viewer from Rasteredge DocImage SDK for .NET, C#.NET can also be used to view, process and annotate image and document in C#.NET applications. barcode reader from image, how to add image in pdf using c#, pdf to jpg c#, c# pdf viewer control, pdf converter, c# load tiff to bitmap. Written in 100% managed C# code and developed in .NET Framework 2.0, this profesional and clean .NET doc imaging library SDK can help C# developers create a Windows document and image (picture/photo) viewer without using other external file viewing SDKs.
Related .net document control helps: annotate pdf using c#: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C# view powerpoint: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
c# mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects view text file in browser: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET edit pdf image using c#: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C# edit pdf text control: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET pdf viewer control free: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
In this C#.NET tutorial page, you will find following aspects related to C#.NET Windows Document & Image Viewer. open word document in c#, display image mvc, preview pdf in mvc, mvc display pdf in view, how to edit pdf file in c#, asp net add text to pdf, how to upload pdf file in database using c#.
  • Key feature list of C#.NET Windows image viewer control SDK
  • Related APIs for this Visual C#.NET Windows document image viewer library add-on
  • How to add a Windows document image viewer in your C#.NET application
  • How to customize your Windows Doc Image Viewer in C#.NET project combine pdf files, c# create pdf page, pdf to image convert in c#, c# pdf reader free, c# pdf to tiff pdfsharp, convert txt file to pdf c#, pdf add pages.
If you want to create a Windows document image viewing application for specific document or image type, please see these pages respectively: C#.NET Windows PDF document viewer SDK, Visual C#.NET Windows TIFF image viewer add-on and Windows Word (.doc/.docx) file viewer control .
C# Windows Document Image Viewer Features
  • No need for client download, installation, & flash plugin
  • Easily integrated into Visual C#.NET Windows application
  • Support creating Windows doc image viewing project in Visual Studio 2005 or greater versions
  • Programmed in full C# code and compatible with .NET-compliant programming languages C# & VB.NET
  • Support displaying and viewing multiple document & image formats (PDF, MS Word, Tiff, Png...) in C#.NET Windows class application
  • Users are allowed to add own commands to customize C#.NET Windows document & image viewer
  • Easy to create high-quality image thumbnails & automatic navigation from thumbnails to main Windows viewer
  • Provide flexible document image processing functions, like document image zooming and panning
  • Allow C#.NET developers to redact image and document with various text or graphical annotations
  • Mature Windows viewer control for C#.NET imaging application, allowing direct document and image saving
C#.NET Windows Doc Image Viewer Control APIs
RasterEdge .NET Windows Viewer Control provides C# developers with many APIs. The following list will give you a broad overview of these APIs functions.
  • LoadFromFile(String filePath): Accept the path of the file that you want to open in C#.NET Windows Viewer Control.
  • SaveFile(String filePath): Save loaded file to a specified path in C#.NET Windows Viewer Control.
  • UpPage, DownPage: Scroll to previous or next visible page in the currently open document.
  • ZoomIn, ZoomOut: Increase or decrease current zoom percentage of C#.NET Windows Viewer.
  • FitWidth, FitHeight, ShowOneToOne: Reset size of the currently displayed page.
  • AddPage: Prior to the currently displayed page to add a blank page.
  • DeletePage: Delete the currently displayed page.
  • Roate90, Rotate180, Rotate270: Rotate the currently displayed page 90, 180 or 270 degrees clockwise.
  • DrawText, DrawFreehand, DrawLine, DrawPolygonLines, DrawFilledRectangle, DrawRectangle, DrawHighLight, DrawEllipse, DrawPolygon, DrawRubberStamp: Draw specified type annotation on viewing page in C#.NET Windows Viewer.
  • BurnAnnotation: Burn all text or graphical annotations to viewing page.
  • DeleteAnnotation: Delete all selected text or graphical annotations.
How to Add Windows Viewer Control in C#.NET Application
This part will guide you to add .NET WinViewer control to your Visual C# project and invoke APIs of this control. See detailed steps below. (For VB.NET developers, please go to Create Windows Image Viewer using VB.NET Programming Code.)
  1. Set up your C#.NET Windows project;
  2. Open file from specified path;
  3. Draw specified type annotation on viewing file page.

Set up C#.NET Windows Project

  1. In Visual Studio, create a new C#.NET Windows Forms project called WinViewerDemo. If you already have a Windows Forms project, this step can be omitted.
  2. Add WinViewer control to your C#.NET project reference. Right-click on "Toolbox", select "Choose Items...", locate "RasterEdge.DocImagSDK8.0\bin" in download package, and browse to find and select "RasterEdge.Imaging.WinformsControl.DocumentViewer.dll", then .NET WinViewer control will appear in Toolbox.

Open File from Specified Path

There may be other elements on your C#.NET Windows application form, but in the following tutorial, we will take a blank form as an example.
  1. Drag the .NET WinViewer control onto your C#.NET Windows application form.
  2. Now, you only need several lines of C#.NET code to open a document in Windows viewer. And the following C#.NET code presents an open file dialog. You can select a file to be loaded into the WinViewer control. If the file format is not supported by .NET WinViewer control, there will prompt a window "cannot open your file".
private void OpenFile_Click(object sender, EventArgse)
OpenFileDialogofd = new OpenFileDialog();
ofd.Filter = "(*.*)|*.*";
ofd.Multiselect = false;
if (ofd.ShowDialog() == DialogResult.OK)

Draw Specified Annotation on Viewing Page

You can directly call a single C#.NET method for each kind of annotation that you want to support in your toolbar button's Onclick events. Resizing, burning, deleting and moving are all built in.
private void HighLight_Click(object sender, EventArgse)

private void Text_Click(object sender, EventArgse)
Right-clicking on the created annotation in C#.NET Windows Viewer, you will see the option to burn or delete. If you right-click on the thumbnail, there is the option to "Add new page" or "delete page". Using RasterEdge .NET WinViewer Control, there's necessary for you to add some buttons to complete these operations.
How to Customize Windows Doc Image Viewer in C#.NET Project

Customize C#.NET Windows Viewer Toolbar

It's easy to see from the above example that you can customize your toolbar in C#.NET Windows Doc Image Viewer, and the only thing you need to do is call the appropriate API.

Customize Annotation Style in C#.NET Windows Viewer

RasterEdge gives you default Annotation Style, but also allows you to modify the style according to your preferences. Here we take the styles modification of HighLight annotation and Text annotation as examples.
private void HighLight_Click(object sender, EventArgse)
this.winViewer1.HighLightAnnoStyle.FillColor = Color.Red;
this.winViewer1.HighLightAnnoStyle.Transparency = 0.2f;
private void Text_Click(object sender, EventArgse)
   this.winViewer1.TextAnnoStyle.FillColor = Color.Yellow;
this.winViewer1.TextAnnoStyle.AnnoText = "double click to edit your content";
this.winViewer1.TextAnnoStyle.TextFont = new Font("Arial", 15, FontStyle.Bold | FontStyle.Italic);
this.winViewer1.TextAnnoStyle.Transparency = 0.8f;

Customize the Way to Open and Store File

The C#.NET WinViewer control offers developers two APIs to LoadFile. One is LoadFromFile(string filePath), and the other is LoadFromFile(Stream stream). Developer can feel free to invoke different APIs to customize the way to open and store files.

Customize Drop-down List of C#.NET Windows Viewer

Events, like OnFileAdded, PageIndexChanged and SelectedIndexChanged, are available to be used to customize the drop-down list of C#.NET Windows Document & Image Viewer. If you don't use the drop-down list, please omit these events.
  • OnFileAdded: Mainly in order to obtain the total number of document pages.
  • PageIndexChanged: Click on thumbnail to change the drop-down list displayed value.
  • SelectedIndexChanged: According to the value of selected drop-down list to switch pages.
See more Image Viewer Creation Tutorial!
More Tutorials!
Find more user guides with RasteEdge .NET Image SDK using Visual C# sample codings!

Recommend this to Google+ is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2024 Raster