Description

Get a list of coordinate points that describe a feature.

Return Type

A Long value.  

The number of points needed in PointsResults or the number of points filled into that variant. If pvPoint contains a safearray of long/float/double, then pNumPoints will be equal to half the size of that safearray since there are two values per point.

Syntax

object.GetFeaturePoints (FeatureIndex, [PointsResults])

The GetFeaturePoints Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McFeatures.
FeatureIndexRequired. A Long value.

The index of the feature. If this is a negative number, then for McPoints only, the coordinates of all points are returned. Otherwise this must be a feature index value between 0 and Count minus 1.

PointsResultsOptional. A Variant value.

If NULL or missing (VT_ERROR or VT_NULL), then only the count is returned. If pointing to an empty variant (VT_EMPTY), then this variant is filled with an array of SINGLEPOINT records containing X,Y pairs of points. Otherwise PointsResults must point to a variant containing a safearray or record(s) of the proper type and size. Allowed types are LONGPOINT, LONGRECT or long, SINGLEPOINT, SINGLERECT or float (AKA Single in VB), and DOUBLEPOINT, DOULBERECT or double. A non-emtpy variant of the right size and type will be filled with x,y pixel coordinate values (one XXXPOINT per point or two long/float/double per point)

Remarks

For most types of features, the coordinates returned by GetFeaturePoints will be a standard description of the feature that will allow its duplication when passed to the SetFeaturePoints method (see Notes for exceptions).

For McPoints, each feature is 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.

Coordinates are returned into an array of values, POINT or RECT structs supplied by the caller (see Example). The type of the returned result depends on the type of array that the caller supplies. If the caller supplies a Missing or Null pvPoints result variant (VT_ERROR or VT_NULL), then just the number of points required to hold the returned array will be returned.

If the caller supplies an Empty pvPoints result variant (VT_EMPTY), then that variant is filled with an array of SINGLEPOINT X,Y results (VT_RECORD variant type).

For McPoints, it is possible to return all feature points as an array. This cannot be done for McLines or McRegions, where the coordinates of only one feature at a time may be retrieved. The default SINGLEPOINT results for Empty pvPoints, is always an array, even if only a single point is requested. As illustrated in the examples, you can supply a scalar SINGLEPOINT, if you wish.

Only one basic description of feature coordinates is generated by this function. Use GetFeaturePointsEx for a number of other types of feature coordinate information.

Although this property is really intended for McRegions of Type mcftOutline, it will return a proper list of points in most cases.

mcftOutline: The points defining the outline

mcftBox: 4 points (one point for each corner of the box)

mcftEllipse: The points defining the outline of the ellipse/circle

mcftScanList: The outline of the indexed region will be generated
and its points returned.

However, only in the mcftOutline case will the same Type of feature be recreated by a call to SetFeaturePoints

Exceptions

Selected indices must be less than the Count property.