Click or drag to resize

McMeasurementsLocateEdgePoints Method

Helper function that returns Rising or Falling edge (or both) from a line when OneEdgeOnly is True, get only one dominant edge if False, get one Rising Edge and one Falling Edge

Namespace:  MediaCy.Addins.Measurements
Assembly:  MediaCy.Addins.Measurements (in MediaCy.Addins.Measurements.dll) Version: 3.1.0.0
Syntax
VB
Public Function LocateEdgePoints ( 
	vFeatures As Object,
	vLine As Object,
	ByRef vOutLine As Object,
	OneEdgeOnly As Boolean
) As Integer

Parameters

vFeatures
Type: SystemObject
vLine
Type: SystemObject
vOutLine
Type: SystemObject
OneEdgeOnly
Type: SystemBoolean

Return Value

Type: Int32

Implements

IMcMeasurementsLocateEdgePoints(Object, Object, Object, Boolean)
Examples
VB
Sub TestFindCircle(ByVal x As Single, ByVal y As Single, ByVal r As Single)
    Dim p As SINGLEPOINT, OutPoints As System.Collections.ArrayList
    p.x = x
    p.y = y
    McMeasurements.ThisAddin.Options.CaliperWidth = 1
    McMeasurements.ThisAddin.Options.CaliperMatchLength = 15
    ThisApplication.ActiveImage.AnnotationOverlay.RemoveAll()
    GetCirclePoints(ThisApplication.ActiveImage, p, r, OutPoints)
End Sub
Function GetCirclePoints(ByVal Image As McImage, ByRef InPoint As SINGLEPOINT, ByVal Radius As Double, ByRef OutPoints As System.Collections.ArrayList) As Long
    Dim NSteps As Long
    NSteps = 6
    Dim i As Integer, OutColl As New System.Collections.ArrayList, j As Integer
    For i = 0 To NSteps - 1
        Dim InLine(1) As SINGLEPOINT
        InLine(0).X = InPoint.X + Radius * Cos(i * 3.14 / NSteps)
        InLine(0).Y = InPoint.Y + Radius * Sin(i * 3.14 / NSteps)
        InLine(1).X = InPoint.X - Radius * Cos(i * 3.14 / NSteps)
        InLine(1).Y = InPoint.Y - Radius * Sin(i * 3.14 / NSteps)
        Dim NEdges As Long, out As Object
        NEdges = McMeasurements.ThisAddin.LocateEdgePoints(Image.LineFeatures, InLine, out, False)
        For j = 0 To NEdges - 1
            Dim p As SINGLEPOINT
            p.X = out(j).X
            p.Y = out(j).Y
            OutColl.Add(p)
        Next j
    Next i
    OutPoints = OutColl
End Function
See Also