DrawPatternMatch Method
Syntax
CWMachineVision.DrawPatternMatch Overlay, PatternMatch [, Color]
Return Type
On success, this method returns 0. On failure, this function returns a negative number.
Purpose
Draws a crosshair and a framed circle centered at the position of the pattern match result, and a rotated rectangle that illustrates the bounding points.
Remarks
This function is used by CWMachineVision.FindPattern to overlay matches. It is exposed as a convenience method.
Parameters
Overlay As CWIMAQOverlay
The overlay onto which to draw the crosshair and framed circle.
PatternMatch As CWIMAQPatternMatchReportItem
The pattern match to draw.
Color As Variant
[Optional] The color of the overlay. If not supplied, the DefaultColor property of the CWIMAQOverlay object is used.
Example
Private Sub Run_Click() 'Create a dummy pattern match report item so we can overlay it. These numbers were taken from 'an actual pattern match report Dim Report As New CWIMAQPatternMatchReport Report.Add Report(1).Angle = 154 Report(1).BoundingPoints.Initialize Array(202.0943, 155.357, 178.1523, 224.8896, 202.0943), _ Array(171.5639, 148.7686, 102.0313, 124.8266, 171.5639) Report(1).Position.Initialize 190.1233, 136.7976 Report(1).Score = 988.3238 'Draw the pattern match CWMachineVision1.DrawPatternMatch CWIMAQViewer1.Image.Overlays(1), Report(1), vbBlue End Sub