McProfileEdges Interface |
![]() |
Namespace: MediaCy.IQL.Features
Public Interface McProfileEdges Inherits IMcProfileEdges
Option Explicit 'the example demonstrates using of McLineProfiles class 'main part of the code is in frmLineProfiles.frm file 'more examples for McLineProfiles are included into the Caliper VBA sample project Sub LineProfileTest() 'load demo image Images.Open (Path & "Images\ColorDot.tif") frmLineProfile.Show False 'add a line to LineFeatures ActiveImage.LineFeatures.SetFeaturePoints 0, Array(50, 50, 250, 150) 'draw profile of first line frmLineProfile.DrawProfile ActiveImage.LineFeatures.Profiles, 0 End Sub
VERSION 5.00 Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} frmLineProfile Caption = "Line Profile" ClientHeight = 4470 ClientLeft = 45 ClientTop = 435 ClientWidth = 7800 OleObjectBlob = "frmLineProfile.frx":0000 StartUpPosition = 1 'CenterOwner End ' 'line profile viewer ' 'see Caliper sample VBA project for more examples on McLineProfiles ' 'line profile overlay, which will receive OnCreate event Private WithEvents LineProfileOverlay As McGraphOverlay Attribute LineProfileOverlay.VB_VarHelpID = -1 'draws line profile in the graph Public Function DrawProfile(LineProfile As McLineProfiles, ByVal Index As Long) If LineProfile Is Nothing Then Chart1.Visible = False Exit Function End If If Index < 0 Or Index >= LineProfile.CountOfProfiles Then Chart1.Visible = False 'index is out of range Exit Function End If 'change series grouping depending on number of channels Chart1.Plot.DataSeriesInRow = (LineProfile.NumberOfChannels = 1) 'set values Chart1.ChartData = McObjectTemp(LineProfile.ProfileValues(Index)).value 'set pen width Dim vCol As Variant For Each vCol In Chart1.Plot.SeriesCollection vCol.Pen.Width = 1 Next 'make visible Chart1.Visible = True End Function 'create new line profile button Private Sub CommandButton1_Click() If ActiveImage Is Nothing Then Exit Sub ActiveImage.LineFeatures.Reset 'clear any existing lines 'sync master overlay of LineFeatures Set LineProfileOverlay = ActiveImage.LineFeatures.AutoDisplayOverlay 'start line creating tool LineProfileOverlay.SelectTool "", "McGraphObjLine", mcgtStandardAutoDisplay 'and monitor LineProfileOverlay_ObjectCreated event End Sub Private Sub LineProfileOverlay_ObjectCreated(ByVal Overlay As McGraphOverlay, ByVal Object As McGraphObj) 'draw last created line DrawProfile ActiveImage.LineFeatures.Profiles, 0 Overlay.SelectTool 'turn off the tool End Sub