How to use Annotation methods without using the ImageKit's Standard Toolbar control

Example Code

In this example, we use code to perform the same functions that Toolbar buttons perform and draw an object.

[Visual Basic.NET]

'When using Annotation functions, the following property must be set to True.
ImageKit1.Edit.EditEnabled = True

'Use the color dialog to set the color of the line or text
Dim colDialog As New ColorDialog()
If (colDialog.ShowDialog = Windows.Forms.DialogResult.OK) Then
     ImageKit1.Edit.ForeColor = colDialog.Color
End If

'Set the width of the pen
ImageKit1.Edit.PenWidth = 10

'Set the type of object to Polyline (when drawing an object with the mouse)
'When drawing with a method, as shown below, it is not necessary to set the KindOfEdit property.
ImageKit1.Edit.EditKind = Newtone.ImageKit.Win.KindOfEdit.Polyline

'Draw Polylines with methods without using the mouse
Dim pts As Point() = {New Point(0, 0), New Point(10, 50), New Point(50, 10)}
ImageKit1.Edit.DrawPolyline(pts)

'Embed the objects into the base image (rasterize them)
ImageKit1.Edit.DrawEditedObjectsToImage()

'Select the third object and delete it
ImageKit1.Edit.SelectObject(3)
ImageKit1.Edit.DeleteSelectedObjects()

[Visual C#.NET]

//When using Annotation functions, the following property must be set to True.
ImageKit1.Edit.EditEnabled = true;

//Use the color dialog to set the color of the line or text
ColorDialog colDialog = new ColorDialog();
if (colDialog.ShowDialog == Windows.Forms.DialogResult.OK)
{
     ImageKit1.Edit.ForeColor = colDialog.Color;
}

//Set the width of the pen
ImageKit1.Edit.PenWidth = 10;

//Set the type of object to Polyline (when drawing an object with the mouse)
//When drawing with a method, as shown below, it is not necessary to set the KindOfEdit property.
ImageKit1.Edit.EditKind = Newtone.ImageKit.Win.KindOfEdit.Polyline;

//Draw Polylines with methods without using the mouse
Point[] pts = { new Point(0, 0), new Point(10, 50), new Point(50, 10) };
ImageKit1.Edit.DrawPolyline(pts);

//Embed the objects into the base image (rasterize them)
ImageKit1.Edit.DrawEditedObjectsToImage();

//Select the third object and delete it
ImageKit1.Edit.SelectObject(3);
ImageKit1.Edit.DeleteSelectedObjects();

Relevant Properties

ImageKit.Edit.EditKind
ImageKit.Edit.ForeColor
ImageKit.Edit.BackColor
ImageKit.Edit.PenWidth
ImageKit.Edit.Fill

Relevant Methods

ImageKit.Edit.DrawLine
ImageKit.Edit.DrawPolyline
ImageKit.Edit.DrawPolygon
ImageKit.Edit.DrawRectangle
ImageKit.Edit.DrawEllipse
ImageKit.Edit.DrawRoundRectangle
ImageKit.Edit.PasteImage
ImageKit.Edit.DrawText
ImageKit.Edit.DrawStamp
ImageKit.Edit.SelectObject
ImageKit.Edit.SelectAllObjects
ImageKit.Edit.DeleteSelectedObjects
ImageKit.Edit.CutSelectedObjects
ImageKit.Edit.CopySelectedObjects
ImageKit.Edit.PasteCopiedObjects
ImageKit.Edit.MoveToFront
ImageKit.Edit.MoveForwardOne
ImageKit.Edit.MoveBackOne
ImageKit.Edit.MoveToBack
ImageKit.Edit.Undo
ImageKit.Edit.Redo
ImageKit.Edit.DrawEditedObjectsToImage
ImageKit.Edit.ClearAllObjects

The ImageKit.NET3 is created by Newtone Corporation