Measure image margins
Visual Basic |
---|
Public Function MeasureMargins() As CiRect |
Returned CiRect object represents a rectangle on the image within which all image or ROI black pixels are located. If image or ROI contains no pixels, 0 or Nothing is returned.
VB Example (Visual Basic) | Copy Code |
---|---|
Public Sub T_MeasureMargins(ByRef Tools As CiTools) Dim Rect As CiRect Set Rect = Tools.MeasureMargins If (Rect Is Nothing) Then Debug.Print " Margins: N/A" Else Debug.Print " Margins: l=" & Rect.left & " t=" & Rect.top & _ " r=" & Tools.Image.Width - Rect.right & " b=" & Tools.Image.Height - Rect.bottom End If End Sub |