Visual C#.NET - Image Hotspot Annotation

C# Samples on How to Add Hotspot Annotation on Image in .NET Projects
Yiigo.Image for .NET is a library toolkit with several DLLs for image & document processing & editing. Among all the features, annotation is the one to allow developers and users to add, draw, visualize, remove, rotate, and resize objects onto image files and documents. If you want to save the annotation for future use, you can burn the annotations into image, or you can simply save it and load it from your system memory next time.
Yiigo image annotation tool supports various objects, among which hotspot is available in rectangle and freehand styles. Unlike other annotation, a hotspot annotation is one that will be invisible in general. But when the cursor hovers over the area, the cursor will change to indicate that it can be clicked. Below are two samples for adding rectangle hotspot and freehand hotspot annotations into your Visual C#.NET image project.
C# Guide - How to Add Hotspot Annotation on Image

C# Image Hotspot Annotation - Preparation

  • Yiigo.Image for .NET Download: Download this C# imaging library SDK online and unzip the file.
  • Yiigo.Image for .NET Installation: Install the Visual C# image component by running the exe file.
  • Yiigo.Image for .NET Activation: Activate the purchased license by entering the serial number or requesting an evaluation license first and follow the wizard for activation.

C# Image Hotspot Annotation - Rectangle Annotation

  • Minimum requirement first: you should have installed Microsoft Visual Studio 2005 or above, or Visual Studio Express.
  • Start your Visual Studio and create an empty Visual C#.NET imaging project with the given template. Or you can open the C# image project you are working on.
  • Now you can add the annotation library DLL to your project reference: Yiigo.Image.Annotation.dll.
  • Enable the namespace Yiigo.Image.Annotate in your project.
  • Copy the C# sample code below to add a rectangle hotspot annotation on your png image. Other image formats are supported including Jpeg, Gif, Tiff, etc.
  • You can also adjust annotation settings, such as flipping, rotating, resizing, text editing, etc.
using System;
using System.Object;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using Yiigo.Image.Annotation;

/*Create a freehand hotspot annotation on your image.
FreehandFotspotAnnotation myAnnotation = new FreehandHotspotAnnotation();
*/

// Create a rectangle hotspot annotation on your image.
HotspotAnnotation myAnnotation = new HotspotAnnotation();

myAnnotation.AnnotationData = "Hotspot Annotation";
myAnnotation.Fill = new AnnotationBrush(Color.Blue);
myAnnotation.Shadow = new AnnotationBrush(Color.Blue);
myAnnotation.Location = new PointF(100, 100);
myAnnotation.Size = new SizeF(120, 80);
annotationController1.CurrentLayer.Items.Add(myAnnotation);

C# Image Hotspot Annotation - Freehand Hotspot Annotation

  • Start your Microsoft Visual Studio and open your Visual C# image project.
  • Add Yiigo.Image.Annotation.dll to your project reference.
  • Copy the C# sample code below to add a freehand hotspot annotation on your png image.
  • Now you need to use your mouse to draw out the shape of the freehand hotspot annotation. Then you can customize the annotation settings in Visual C# coding.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using Yiigo.Image.Annotation;

//Create a freehand hotspot annotation on your image.
FreehandFotspotAnnotation myAnnotation = new FreehandHotspotAnnotation();

C# Image Hotspot Annotation - Settings & Parameters

  • Location stands for the center point of the hotspot annotation, measured by the horizontal and vertical coordinates.
  • Size stands for the width and height of the freehand rectangle annotation, measured in pixel.
  • Color parameter is the one for you to customize the outline color and the rectangle background color.
C# Image Project - Other Annotations Creation
Products
Other Plugins
Image Viewer CoreBarcode PluginPDF Read & WriteTesseract OCR PluginForm Processing PluginJBIG2 CodecJPEG2000 CodecISIS ScannerTwain ScannerDICOM ReaderCAD Scanner