Guide for C#
Core Document Formats
Additional Features
Freehand Line Annotaion

C# Imaging - Freehand Line Annotation in C#

Visual C# Image Freehand Line Annotation Guide within .NET Imaging DLL

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

C# Freehand Line Annotation on Image Overview
With the simple C#.NET image annotation library, both the developers and end-users can easily and quickly add and draw freehand line annotation to single or multi-page images with very simple C# code. Besides, using our image annotating developing APIs, C#.NET developers can create a fully-automated, dynamic, and feature-packed annotation application that also can be operated by end users. C# freehand line annotation tool here allows users to create and customize image annotation objects on multiple image formats: JPEG, BMP, PNG, GIF and TIFF.
Related .net document control helps: pdf viewer control: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET dicom web viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET excel view: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser. view text file: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET office document viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
document viewer c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer... sharepoint document viewer free: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
From this image freehand line annotation tutorial, users can learn:
  • Benefits and features of creating, customizing, saving and printing freehand line annotation in C# class
  • C# Windows project to implement image freehand line annotation function
  • Detailed C# method and sample code to create freehand line annotation to image page
  • Tutorials on how to add freehand line objects to PDF, Word and TIFF document pages
C# Image Freehand Line Annotation Benefits and Features
  • Image freehand line annotation function programmed in complete C#. NET class
  • Easy to install .NET image annotating dll to your C#.NET applications
  • Freehand line annotation can be added to bitonal, color and grayscale images
  • Full sample code to support optional freehand line annotation parameter settings
  • Colorize the freehand line annotation within powerful imaging processing SDK
  • Protect sensitive image information with redaction and encryption annotation objects
  • Support variable annotation object storage options including image files, separate annotation files, database, memory, and more
  • Print created annotation image by using .NET imaging printing library
C# code to Create Freehand Line Annotation on Image
We will demonstrate the tutorial of creating freehand line annotation to image page from following three modules:
  • Create and run a C# programming application for adding freehand line annotation object
  • Method to draw freehand line annotation to image in C# class
  • Compliant pieces of C# codes for creating and customizing freehand line annotation

Create and Run a C# Development Application

This part will guide users to create an image freehand line annotation project in Visual C# language.
  1. Start Microsoft Visual Studio 2005, 2008 or 2010 version;
  2. Create the required C# Windows application;
  3. Add .NET Imaging Annotating DLLs to your Visual C# applications by right click "Add Reference...";
    • RasterEdge .Imaging.Basic.dll
    • RasterEdge .Imaging.Annotation.dll
  4. Run image processing and annotating applications below in C# project:
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

Freehand Line Annotation Method in C#

Using following two sets of freehand line annotation methods to add and customize image annotation by setting line point data.
public static FreeHandLineAnnotation CreateFreeHandLineAnnotation(LinePoint[] points);
public static FreeHandLineAnnotation CreateFreeHandLineAnnotation(LinePoint[] points, LinePen aPen);

C# Code to Create Freehand Line Annotation

Following displayed code shows how to create freehand annotation on image with above methods. This complete C# sample function code enables users to customize annotation line width & property, point location and line closed loop parameter.
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 FreehandLineAnnotationDemo
* SDK Dependency:
* RasterEdge.Imaging.Annotation.dll

public static void Test()
FreeHandLineAnnotation obj = new FreeHandLineAnnotation();//create a new freehand line
//set Track points
obj.Points = new List<LinePoint>();
obj.Points.Add(new LinePoint(30.0F, 34.0F));
obj.Points.Add(new LinePoint(20.3F, 123.0F));
obj.Points.Add(new LinePoint(134.0F, 32.0F));
obj.Points.Add(new LinePoint(134.0F, 110.0F));

//set line size
obj.LinePen = new LinePen();
obj.LinePen.Width = 3.0F;//set line width

//set line property
obj.LinePen.Brush = new AnnotationBrush();
obj.LinePen.Brush.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set line style
obj.LinePen.Brush.Solid_Color = Color.Blue;//set line color

//when the track has Closed loop, set the Closed loop property as below
obj.Fill = new AnnotationBrush();
obj.Fill.FillType = RasterEdge.Imaging.Annotation.FillType.Solid;//set Closed loop style
obj.Fill.Solid_Color = Color.Pink;//ser closed loop color

string folderName = "C:/";
Bitmap img = obj.CreateAnnotation();
img.Save(folderName + "FreehandLineAnnotation.png");
catch (Exception ex)
Freehand Line Annotating Functions in PDF, TIFF and Word
Our .NET Imaging Annotating SDK supports creating freehand line annotation shapes not only on image files, but also on document pages in C# program. As for particular document annotation functions, please see contents listed below.

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-2023 Raster