Guide for VB.NET
Core Document Formats
Additional Features
Line Annotation

VB.NET Imaging - Add Line Annotation Using VB.NET

How to Use Visual Basic .NET Image DLL to Annotate Image with Line(s)

VB.NET
Home > .NET Imaging SDK > VB.NET > Line Annotating
To get started with DocImage SDK for .NET, you are supposed to read VB.NET Imaging: Get Started first!

RasterEdge Image SDK for .NET has included in the package a fully functional Visual Basic .NET image annotating control library. Written in C# managed code, this annotating component offers perfect integration into .NET Framework and Microsoft Visual Studio.
Related .net document control helps:
asp.net word viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
asp.net document viewer c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
asp.net text file viewer: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net pdf page: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
asp.net pdf viewer: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
If you have a picture or document in which there are some important sections you want to underline, you can simply choose this Visual Basic .NET image processing control to add a line annotation with some VB.NET codings. Detailed guide and complete sample codes are provided for you to easily integrate this library to annotate with a line or more.
What's more, this VB.NET annotating DLL provides you with flexible options to easily adjust various properties for the line annotation. For example, you can define any location of the line annotation by specifying the start and stop points. To make the line annotation more eye-catching, you can add a variety of line caps such as arrow, butt, diamond, ellipse, etc. In addition, VB.NET developers can easily remove, resize and rotate the line annotation object any way you want.
In the following paragraphs, we will provide you with detailed guide and demo codings for creating a line annotation on an image in a Visual Basic .NET image manipulation project. Here are the sections that will appear later:
  • Visual Basic .NET annotation library overview
  • Visual Basic .NET method for image line annotating with .NET Image library SDK
  • Visual Basic .NET full sample codes for printing line annotation on images
VB.NET Image Line Annotation Overview
  • Mature image processing library for adding line annotation in Visual Basic. NET program
  • Easy to be integrated into VS .NET projects such as Windows Application
  • Line annotations can be easily moved, rotated and resized with VB.NET programming
  • Rich settings for customizing various line annotation properties like width, style, color and so on
  • Also supports many other types of annotations besides lines
  • Easy to install and use without using any third party toolkit like Adobe Photoshop
  • Supports commonly used image formats such as jpeg, gif, png, tiff and bmp, etc
VB.NET Method for Line Annotation on Image
Demonstrated in the code tab below is a VB.NET code snippet for creating a user-defined line annotation on an image with this RasterEdge image annotating library SDK. To add a line annotation, you will need to draw a starting point for the line annotation first, then the stopping point, and finally save the updated image (the one with line annotation embedded) to your local disk for later use.
If you need a more specific demo, we have actually prepared you with a ready to use demo application, which you can find in the unzipped download package. The file is named "LineAnnotationDemo.cs" under the RasterEdge.Imaging.Demo.Annotation folder.
Public Shared Function 
CreateLineAnnotation(start As LinePoint, [end] As LinePoint) As LineAnnotation
End Function

Public Shared Function
CreateLineAnnotation(start As LinePoint, [end] As LinePoint, aPen As LinePen) As LineAnnotation
End Function

Public Shared Function
CreateLineAnnotation(x0 As Single, y0 As Single, x1 As Single, y1 As Single) As LineAnnotation
End Function

Public Shared Function
CreateLineAnnotation(x0 As Single, y0 As Single, x1 As Single, y1 As Single, aPen As LinePen) As LineAnnotation
End Function
VB.NET Codes for Line Annotation on Image
Displayed below are the complete Visual Basic .NET sample codes for adding a line annotation on your image (supporting png, jpeg, gif, tiff and bmp) with RasterEdge image processing and annotating library SDK.
If you already have a Visual Basic .NET image editing application, you can copy the demo codes below to your program. Debug and a new image named "LineAnnotation.png" will be saved to your local disk C.
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports RasterEdge.Imaging.Annotation
Imports System.Diagnostics
Imports RasterEdge.Imaging.Annotation.Basic

Namespace annotation_trial
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub

Private Sub button1_Click(sender As Object, e As EventArgs)

Dim obj As LineAnnotation = AnnotationGenerator.CreateLineAnnotation(60F, 45F, 560F, 228F)
'create a new LineAnnotation with start and end point
obj.LinePen = PenGenerator.CreateLinePen(Color.Blue, 5F)
'set line color and width
'set line startcap
obj.LinePen.StartCap = New RasterEdge.Imaging.Annotation.Basic.LineCap()
obj.LinePen.StartCap.Cap_Width = 2F
'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 = 10F
obj.LinePen.EndCap.CapStyle = RasterEdge.Imaging.Annotation.LineCapStyle.Rectangle

Dim folderName As String = "C:/"
Dim img As Bitmap = obj.CreateAnnotation()
img.Save(folderName & "LineAnnotation.png")
End Sub
End Class
End Namespace


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