This method calculates the distance betweent two points.

[Visual Basic]Public Function CalculateDistance(pt1 As Point, pt2 As Point, unit As LengthUnit, dpi As Integer) As Double
[C#]public double CalculateDistance(Point pt1, Point pt2, LengthUnit unit, int dpi);

Parameters

pt1
Coordinates of the first point
pt2
Coordinates of the second point
unit
Units as LengthUnit
dpi
Dpi of the image to be measured (integer value)

Return Value

The distance between the two points (double value)

Explanation

The CalculateDistance method calculates the distance betweent two points. the result will be returned in values defined by the units parameter. When unit is set to LengthUnit.mm or LengthUnit.Inch, the value set for dpi is also taken into account. If unit is set to LengthUnit.None, the result is the same as for LengthUnit.Pixel.

You can also use the MouseUpImage event or the annotation object's SelectedObjectDrawPoints property to determine the distance between two clicked points on the image displayed in the ImageKit control.

See Also

ImageKit Members | Newtone.ImageKit.Wpf.ImageKit

 

The ImageKit WPF is created by Newtone Corporation