IMcPointsSetFeaturePoints Method
|
|
Set the coordinate points that describe a feature.
Namespace:
MediaCy.IQL.Features
Assembly:
MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
SyntaxSub SetFeaturePoints (
FeatureIndex As Integer,
Points As Object
)
Parameters
- FeatureIndex
- Type: SystemInt32
The index of the feature being set. If this is a negative
number, then for McPoints only, the coordinates of all points are set from
the Points array. Otherwise this must be a non-negative feature index.
Features other than the one being set are not disturbed; call Reset before
using this method if you want to ensure that any existing coordinates are
cleared. If the FeatureIndex is equal to the Count property, then a new
feature is created and appended as the last one. - Points
- Type: SystemObject
Allowed types are LONGPOINT, LONGRECT or Long,
SINGLEPOINT, SINGLERECT or Single,
and DOUBLEPOINT, DOULBERECT or Double. This array must be supplied
with x,y pixel coordinate values (one XXXPOINT per point or two
numeric values per point). For McRegions feature boundaries, the final
closing segment is assumed (that is, the last point in the array does
not need to be and should not be the same as the first point).
Implements
IMcFeaturesSetFeaturePoints(Int32, Object)
RemarksIf the FeatureIndex is equal to the Count property, then a new feature
is created and appended as the last one. This is the method used to add new
McPoints, McLines or McRegions features from known coordinates. Features can
also be created from blobs with McPoints.Threshold, McLines.Threshold or
McRegions.Threshold.
For most types of features, the coordinates returned by GetFeaturePoints
can be passed into this method to recreate the feature.
For McPoints, each feature is set by providing a single point X,Y pixel
coordinate. For McLines, each feature is described by a polyline of two or more
X,Y pixel coordinates. For McRegions, each feature is a polyline of three or
more X,Y pixel coordinates, describing a path along the boundary pixels of a
connected region. For McRegions, the type is converted to mcftOutline.
McLines features set by two coordinate pairs (e.g., a single line segment) may
be either mcftLine or mcftPolyline Type, depending on the state of the
mcofDefaultPolyline OptionFlags bit. By default, this bit is clear, so single
segment line features are of type mcftLine, not mcftPolyline. This can
also be determined on a per-feature basis by setting the mcfsfPolyline bit
of the FeatureStatusFlags.
Coordinates are supplied as an array of values, POINT or RECT structs supplied
by the caller (see Example).
For McPoints, it is possible to set all feature points at once by supplying an
array of points. This cannot be done for McLines or McRegions, where the
coordinates of only one feature at a time may be set.
Examples
Dim MyRegions As McRegions
Set MyRegions = Engine.ActiveImage.RegionFeatures
MyRegions.Reset
vMyPts = Array( 0,0, 0,10, 20,10, 20,0)
MyRegions.SetFeaturePoints(0, vMyPts)
ThisApplication.ActiveImage.PointFeatures.SetFeaturePoints -1, Array( 10,20, 15,25, 20,30)
See Also