Description
For a given y-position, get the list of horizontal line segments that lie within the features bounds.
-
Return Type
-
A Long value.
Number of segments returned. This number is half the number of elements returned in pvSegments since each segment is expressed by a pair of values. If the pvSegments argument is missing, then the maximum number of segments in any line is returned.
-
Syntax
-
object.GetLineSegments ([pvSegments], [y], [xMin], [xMax])
The GetLineSegments Method syntax has these parts: |
| object | An expression evaluating to an object of type McFeatures. | | pvSegments | Optional. A Variant value. If given, an empty variant (VT_EMPTY) or a variant containing a safearray of long or LONGRANGE structs. The method will change the empty variant into a variant containing a safearray of long (two long per segment); this array will be large enough to hold the maximum number of segments in any line for the current feature. A non-emtpy variant of an adequate size and of type long will be filled with pairs of end-points (one pair of end-points per segment). If not given, all other arguments are ignored and the maximum number of segments in any line is returned.
| | y | Optional. A Long value. A given line position. If the line lies outside the region, the method returns 0 segments.
| | xMin | Optional. A Long value. The low end of a clipping interval. No segment end-point returned will be smaller than xMin. Optional parameter.
| | xMax | Optional. A Long value. The high end of a clipping interval. No segment end-point returned will be greater than xMax. Optional parameter.
| Remarks
A more efficient means of accessing a bit mask of features, and one that allows specification of a selection of features to be included in the mask, is available via the CreateFeatureMask mask method. The CreateFeatureMask mask method can return an McBitMask object, which allows fast indexed access to foreground segments on all scan lines from one array (by contrast this method requires a call that creates an array for each scan line).
This method is useful for figuring out which pixels of a non-rectangular regions lie within the bounds. By calling GetLineSegments for every line in the bounds, one can determine where the regions start and end along the line, from left to right. Each start and end-point pair defines a segment.
|