Defining Regions Programmatically - National Instruments IMAQTM User Manual

Vision for visual basic
Table of Contents

Advertisement

Defining Regions Programmatically

© National Instruments Corporation
During design time, use the Menu property page to select which tools
appear in the right-click menu. You also can designate a default tool from
this property page. During run time, set the
to select the tools to display, and set
default tool.
You can define ROIs programmatically using the CWIMAQRegions
collection. In IMAQ Vision, shapes are represented by shape objects.
For example, CWIMAQPoint represents a point, and CWIMAQLine
represents a line. Use the following methods listed in Table 3-2 to add
various shapes to the regions.
Table 3-2. Methods that Add Shapes to Regions
Method
AddPoint
AddLine
AddRectangle
AddRotatedRectangle
AddOval
AddAnnulus
AddBrokenLine
AddPolygon
AddFreeline
AddFreeregion
AddRegion
Use the
CWIMAQRegions.CopyTo
CWIMAQRegions object to another.
You can define the regions on a viewer and access the regions using the
CWIMAQViewer.Regions
The individual CWIMAQRegion objects provide access to the shapes in the
collection. Each region has one shape object associated with it. Use the
CWIMAQRegion.Shape
Chapter 3
Making Grayscale and Color Measurements
CWIMAQViewer.Tool
adds a point to the ROI
adds a line to the ROI
adds a rectangle to the ROI
adds a rotated rectangle to the ROI
adds an oval to the ROI
adds an annulus to the ROI
adds a broken line to the ROI
adds a polygon to the ROI
adds a free line to the ROI
adds a free region to the ROI
adds a region object to the ROI
method to copy all the data from one
property.
property to determine what type of shape the
3-5
IMAQ Vision for Visual Basic User Manual
CWIMAQViewer.MenuItems
to select the
Description

Advertisement

Table of Contents
loading

This manual is also suitable for:

Imaq

Table of Contents