Guide for C#
Core Document Formats
Additional Features
Polygon Annotation

C# Imaging - Polygon Annotation Tutorial

How to Draw Polygon Annotation Using C#.NET Annotator Control SDK

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

C# Polygon Annotator Image SDK Overview
RasterEdge C# Polygon Annotator Image Add-on, written in 100% managed C# code and built in .NET Framework 2.0, is a professional and standalone .NET image annotation solution, which can offer C# developers the ability to create and customize polygon annotation in any .NET image applications.
Related .net document control helps:
c# asp.net powerpoint viewer: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
c# asp.net mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
asp.net view tiff images: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net edit pdf text using c#: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net edit pdf page using c#: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
asp.net annotate pdf using c#: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
c# asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
This is the article layout of this C#.NET polygon annotation image SDK tutorial page.
  • Feature list of RasterEdge C#.NET polygon annotator control
  • Guide to use RasterEdge C#.NET polygon annotation SDK
  • C# method for polygon annotation drawing in .NET
  • Sample C# code to create polygon annotation
  • C#.NET polygon annotator add-on FAQs
C# Polygon Annotation Image Control Features
  • 100% clean & robust .NET image solution to draw customized polygon annotation by C# code
  • Created polygon annotation can be saved as common image file, like png, gif and jpeg
  • Free to add & adjust the color and thickness of polygon annotation edge using C#.NET code
  • Offer developers the option to add fully user-defined shadow to created polygon annotation in C#.NET
  • Each setting of created polygon annotation can be adjusted separately by C#.NET class code
  • Able to draw both regular and irregular polygon annotations on document image file in C#
  • Offer reasonable and royalty-free C# developer licenses
Besides this C#.NET polygon annotation control, RasterEdge Annotator Add-on also owns other advanced text and graphic annotating controls. Here we just randomly recommend some other annotation controls which can be used in Visual C# .NET class applications, like C# freehand line annotation, C# rectangle annotation, C# ellipse annotation and C# callout annotation.
Create Polygon Annotation in C# Image Project
RasterEdge Polygon Annotation Image Add-on is an easy to use .NET image annotation library, which can be easily integrated into your C#.NET class application. Here we will guide you to use this professional polygon annotation SDK using C# programming code. Besides, if you want to draw polygon annotation with VB.NET class code, you can read this VB.NET polygon annotation creating tutorial page.
  1. Create or open your C#.NET class application in Visual Studio 2005 or later versions;
  2. Add following polygon annotating dlls (which you can find from the trial package of RasterEdge DocImage SDK for .NET) to your Visual C# .NET class project;
    • RasterEdge .Imaging.Basic.dll
    • RasterEdge .Imaging.Annotation.dll
  3. Define the Namespace of RasterEdge C# Polygon Annotation Add-on;
  4. Now you are ready to create polygon annotation using the sample C# code we offer.
C# Method for Drawing Polygon Annotation
To help C# developers create a fully-featured polygon annotation, RasterEdge Polygon Annotator Add-on adopts the application of X & Y location, which will help developers determine the polygon shape by setting track points. Besides, the color & width of polygon annotation edge and shadow can be also easily user-defined.
public static PolygonAnnotation CreatePolygonAnnotation(LinePoint[] points);
public static PolygonAnnotation CreatePolygonAnnotation(LinePoint[] points, AnnotationPen outline, AnnotationBrush fill);
public static PolygonAnnotation CreatePolygonAnnotation(LinePoint[] points, AnnotationPen outline, AnnotationBrush fill,
AnnotationBrush shadow);
public static PolygonAnnotation CreatePolygonAnnotation(LinePoint[] points, AnnotationPen outline, AnnotationBrush fill,
AnnotationBrush shadow, float shadowX, float shadowY);
C# Code to Create Polygon Annotation
Using the sample C# code below, you will easily create a fully customized polygon annotation and save it to a new image object. From the C# demo code, you will obviously find that RasterEdge C#.NET polygon annotation SDK offers separate C# code to control and adjust each property of created polygon annotation, including track points, border property, filled shape property and shadow property.
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 PolygonAnnotationDemo
{
/*
*
*
* SDK Dependency:
* RasterEdge.Imaging.Annotation.dll
*
*
*/

public static void Test()
{
try
{
PolygonAnnotation obj = new PolygonAnnotation();
//set Track points
obj.Points = new List<LinePoint>();
obj.Points.Add(new LinePoint(105.0F, 92.0F));
obj.Points.Add(new LinePoint(354.0F, 143.0F));
obj.Points.Add(new LinePoint(350.0F, 298.0F));
obj.Points.Add(new LinePoint(222.0F, 345.0F));
obj.Points.Add(new LinePoint(114.0F, 261.0F));

//set annotation edge property
obj.OutLine = new LinePen();
obj.OutLine.Width = 5.0F;//set 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.Green;//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 + "PolygonAnnotation.png");
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
}
}
}
C# Polygon Annotator Image SDK FAQs
Q: Does RasterEdge Visual C# .NET Polygon Annotator SDK offer API for developers to customize polygon annotation generation by adding a gradient background in C#.NET class application?
A: Sorry, currently, RasterEdge C#.NET Polygon Annotator Control SDK can only allow developers to fill the background with one color with C# programming code.

Q: Can RasterEdge C#.NET Polygon Annotator Control allow C# developers to generate a regular polygon annotation by just setting the number of sides?
A: Sorry, RasterEdge Polygon Annotation Component can only decide the shape of created polygon annotation by setting the track point using the application of X & Y location.


Recommend this to Google+


RasterEdge.com 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-2017 Raster Edge.com