This method calculates the distance between two points on the image.

[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
The Point value representing the coordinates of the first point

pt2
The Point value representing the coordinates of the second point

unit
A value of type LengthUnit representing the units of measurement

dpi
An integer representing the resolution of the image where the distance is measured

Return Value

Returns a value for the distance between the two points (Type: double)

Explanation

The CalculateDistance method calculates the distance between two points on the image. The distance is calcuated and the value returned is in units defined by the unit parameter. When unit is set to LengthUnit.mm or to LengthUnit.Inch, the value set in the dpi parameter is relevant to the calculation. When unit is set to Length.None, the result will be the same as when unit is set to LengthUnit.Pixel.

When using the MouseUpImage or the annotation object's SelectedObjectDrawPoints property, it is possible to set the two points by clicking on the displayed image.

See Also

ImageKit Members | Newtone.ImageKit.Win.ImageKit

 

The ImageKit.NET3 is created by Newtone Corporation