Guide for C#
Core Document Formats
Additional Features
Line Annotation

C# Imaging - Line Annotation Guide in C#.NET

C#.NET Line Annotator Control to Draw Line Annotation on Image File

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

C# Line Annotator Control Overview
C#.NET line annotator image control from RasterEdge Annotation SDK is an easy to use API which can help C# developers draw line annotations on target document image file in .NET developing applications. The line annotation created by this RasterEdge line annotating library control can be counted as an independent image object which is easily be adjusted by C# programming code.
Related .net document control helps:
asp.net pdf viewer control: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net dicom web viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net excel view: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
document viewer asp.net c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
asp.net sharepoint document viewer free: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net view text file: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
Besides this C#.NET line annotator image control, RasterEdge Annotation SDK also supports other advanced annotating methods, like callout annotating method, ellipse annotating method, freehand line annotator control, hotspot annotator control, polygon annotator control, rectangle annotation method, rubberstamp annotation method and text annotating control.
To help you have a better insight of this C#.NET line annotating control, we divide this C#.NET line annotating tutorial page into following five parts.
  • Feature list of RasterEdge C#.NET line annotation control toolkit
  • How to draw line annotation in C#.NET project using RasterEdge Line Annotator API
  • C# method for line annotation in target document image file
  • Sample C# code to draw line annotation in .NET application
  • C#.NET line annotation FAQs
C#.NET Line Annotation Image Control Features
  • Professional line annotating solution, designed particularly for .NET class applications
  • Written in managed C# code and own high-compatibility with .NET developing tools, like VS
  • Draw line annotation accurately on source document image file by specifying the starting and ending position
  • Create and customize the startcap and endcap of created line annotation separately using C# code
  • Created line annotation can be saved as an independent image object in C#.NET application
  • Free to set the color and width of created line annotation by C# code
Draw Line Annotation on Image in C#.NET Application
This section aims to tell you how to integrate RasterEdge line annotating image control into your C#.NET class application. Before integrating this C#.NET line annotator control to your C# project, please install Visual Studio 2005 (or above versions) and .NET Framework 2.0 (or greater) first.
  1. Open or create a C#.NET class application within Visual Studio;
  2. Download RasterEdge DocImage SDK for .NET and find the dlls below;
    • RasterEdge .Imaging.Basic.dll
    • RasterEdge .Imaging.Annotation.dll
  3. Integrate above dlls from RasterEdge Line Annotation Add-on into your C# class project references;
  4. Define the Namespace of RasterEdge C#.NET Line Annotator Add-on;
  5. Draw line annotation on source document image file using sample C# code.
C# Method for Line Annotation in .NET
Here we display the method that RasterEdge C#.NET line annotator image SDK has used to draw line annotations on target file. With the application of X & Y location, developers can easily decide the start and end point of drawn line annotation. Besides, this C# line annotator offers separate C# command line to customize the color and width of created line annotating object.
Different from other C# line annotator image controls, RasterEdge Line Annotation Control SDK allows developers to add fully user-defined line startcap and line endcap to created line.
public static LineAnnotation CreateLineAnnotation(LinePoint start, LinePoint end);
public static LineAnnotation CreateLineAnnotation(LinePoint start, LinePoint end, LinePen aPen);
public static LineAnnotation CreateLineAnnotation(float x0, float y0, float x1, float y1);
public static LineAnnotation CreateLineAnnotation(float x0, float y0, float x1, float y1, LinePen aPen);
Sample C# Code to Draw Line Annotation
The following C# programming example will demonstrate developers how to create a customized line annotation and save created line annotation as an image object. Remarkably, from the C# code demo below, you will find that each property of created line annotation can be adjusted separately by C# code.
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 LineAnnotationDemo
{
/*
*
*
* SDK Dependency:
* RasterEdge.Imaging.Annotation.dll
*
*
*/

public static void Test()
{
try
{

LineAnnotation obj = AnnotationGenerator.CreateLineAnnotation(60.0F, 45.0F, 560.0F, 228.0F);//create a new LineAnnotation with start and end point
obj.LinePen = PenGenerator.CreateLinePen(Color.Blue, 5.0F);//set line color and width

//set line startcap
obj.LinePen.StartCap = new RasterEdge.Imaging.Annotation.Basic.LineCap();
obj.LinePen.StartCap.Cap_Width = 2.0f;//set startcap width
obj.LinePen.StartCap.CapStyle = RasterEdge.Imaging.Annotation.LineCapStyle.Diamond;//set startcap style

//set line endcap
obj.LinePen.EndCap = new RasterEdge.Imaging.Annotation.Basic.LineCap();
obj.LinePen.EndCap.Cap_Width = 10.0f;
obj.LinePen.EndCap.CapStyle = RasterEdge.Imaging.Annotation.LineCapStyle.Rectangle;

string folderName = "C:/";
Bitmap img = obj.CreateAnnotation();
img.Save(folderName + "LineAnnotation.png");
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
}


}
}
C#.NET Line Annotation Control FAQs
Q 1: Can I make my line annotation dashed using RasterEdge C#.NET line annotation control SDK?
A 1: Sorry, RasterEdge C#.NET line annotation control SDK does not yet support dashing line annotation by C# programming code.

Q 2: Does RasterEdge C#.NET line annotation library toolkit allow developers to adjust the thickness of created line annotation separately by C# code?
A 2: Yes, using RasterEdge C#.NET line annotator control, developers can adjust many properties of drawn line annotation separately using C# code, including line thickness and line color.


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