Guide for C#
Core Document Formats
Additional Features
Rectangle Annotation

C# Imaging - C# Rectangle Annotation Tutorial

Rectangle Annotator Control for Image Rectangle Annotating in C#.NET

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

C#.NET Rectangle Annotation Overview
This C#.NET rectangle annotation library control from RasterEdge .NET Annotator Add-on successfully stands itself out from other C# rectangle annotator controls based on its powerful functions to create & add fully customized rectangle annotation on source document image file using Visual C# code programmatically. c# convert docx to pdf, tiff jpeg compression c#, how to read data from barcode scanner in c# web application, how to create a thumbnail image of a pdf c#, read pdf file in c#, c# open tiff file. Written in managed C# code and developed in Visual Studio 2005, this C# rectangle annotating assembly component is compatible with all .NET developing applications, like ASP.NET web-based and Windows Forms projects.
Related .net document control helps:
c# powerpoint viewer: 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 tiff images: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control edit pdf text using c#: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET edit pdf page using c#: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C# annotate pdf using c#: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
c# excel viewer: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
Similar to this C#.NET rectangle annotation library control, other RasterEdge annotating controls are also enjoying a wide popularity among C# developers for their advanced and mature annotating features. For instance, this C#.NET callout annotation control toolkit helps developer add a sticky note annotation to source document image file; this rubberstamp annotating control component helps C# developers add digital signature and rubberstamp to target file.
In this tutorial page for how to add rectangle annotation to target document image file, you will find information on following five aspects. pdf reader control, get coordinates of text in pdf c#, convert pdf to tiff, vb net pdf create thumbnail from image, c# itextsharp rotate pdf page, c# draw rectangle in pdf, convert tiff to pdf
C# Rectangle Annotation SDK Features
  • Standalone .NET solution that creates rectangle annotation without depending on other third-party imaging SDKs
  • Created rectangle annotation can be counted as an independent image object to be processed using C# code
  • Easy to create a rectangle annotation with a given size using extremely simple C# code
  • Free to relocate generated rectangle annotation on target document image file using C#.NET
  • Allow developers to add a shadow (whose thickness and color can be adjusted) to rectangle annotation
  • Compatible with .NET Framework 2.0 and above versions
Create Rectangle Annotation in C#.NET
In this section, we will guide you to use RasterEdge C#.NET rectangle annotating control for rectangle annotation on source document image file using Visual C# programming code in .NET class applications.
  1. Download and unzip the trial package of RasterEdge DocImage SDK for .NET (This C#.NET rectangle annotator add-on is contained in this comprehensive .NET imaging SDK.);
  2. Find following dlls (which are used to create customized rectangle annotation on target image file) from downloaded trial package and add them to your own C#.NET class project references;
    • RasterEdge .Imaging.Basic.dll
    • RasterEdge .Imaging.Annotation.dll
  3. Activate the evaluation license key by running the executive file "RasterEdge.Imaging License Manager.exe";
  4. Place created license key txt file at the bin folder where above integrated rectangle annotator dlls are located;
  5. Now, you can create and save a fully-featured rectangle annotation using the C# demo code below.
C#.NET Method to Add Rectangle Annotation
From this C# rectangle annotating method listed below, you can see that RasterEdge rectangle annotator control uses the application of X & Y location to decide the start point of rectangle annotation. And users can easily specify the size of created rectangle annotation by entering the width value and height value directly in C# code. Besides, there are separate command lines to adjust the edge and shadow of created rectangle annotation.
public static RectangleAnnotation CreateRectangleAnnotation(float x, float y, float w, float h);
public static RectangleAnnotation CreateRectangleAnnotation(float x, float y, float w, float h, AnnotationPen outline,
AnnotationBrush fill, AnnotationBrush shadow, float shadowX, float shadowY);
C# Demo Code to Create Rectangle Annotation
The demo C# code below will help developers create a self-defined rectangle annotation and save it to an independent image file.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using RasterEdge.Imaging.Annotation;
using System.Diagnostics;
using RasterEdge.Imaging.Annotation.Basic;

namespace RasterEdge.Imaging.Demo.Annotation
public class RectangleAnnotationDemo
* SDK Dependency:
* RasterEdge.Imaging.Annotation.dll

public static void Test()
RectangleAnnotation obj = new RectangleAnnotation();
// set annotation size
obj.X = 60.0F;
obj.Y = 45.0F;
obj.Width = 561.0F;
obj.Height = 228.0F;

//set annotation edge property
obj.OutLine = new LinePen();
obj.OutLine.Width = 5.0F;//set annotation edge width
obj.OutLine.Brush = new AnnotationBrush();
obj.OutLine.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set annotation edge style
obj.OutLine.Brush.Solid_Color = Color.Blue;//set annotation edge color

//set the property of filled shape
obj.Fill = new AnnotationBrush();
obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set filled shape style
obj.Fill.Solid_Color = Color.Gray;//set filled shape color

//set the property of shadow
obj.ShadowFill = new AnnotationBrush();
obj.ShadowFill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set shadow style
obj.ShadowFill.Solid_Color = Color.DarkGreen;//set shadow color
obj.ShadowX = 10.0F;//set shadow position
obj.ShadowY = 12.0F;
obj.ShowShadow = true;//show shadow or not

string folderName = "C:/";
Bitmap img = obj.CreateAnnotation();
img.Save(folderName + "RectangleAnnotation.png");
catch (Exception ex)
C# Rectangle Annotation Library FAQs
Q: Can I add a border to created rectangle annotation using C#.NET RasterEdge rectangle annotator control?
A: Yes, RasterEdge .NET rectangle annotator control toolkit can not only allow developers to add a border to created rectangle annotation but also offer them the ability to customize the border's properties by separate C# code, like color and thickness.

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