IInkStrokeDisp::GetRectangleIntersections method (msinkaut.h)

Finds the points where a IInkStrokeDisp object intersects a given rectangle.


HRESULT GetRectangleIntersections(
  IInkRectangle *Rectangle,
  VARIANT       *Intersections



The rectangle in ink space coordinates, that describes the hit test area.


When this method returns, contains a VARIANT array that indicates where the stroke intersects the rectangle. The beginning floating point indices are stored in the even indices. The ending floating point indices are stored in the odd indices. The first pair of indices represents the first intersection.

For more information about the VARIANT structure, see Using the COM Library.

Return value

This method can return one of these values.

Return code Description
A parameter contained an invalid pointer.
Cannot allocate Stroke handler helper object.
Unexpected parameter or property type.
An exception occurred inside the method.


This method returns an array that indicates where the stroke intersects the specified rectangle. Each segment of the stroke that intersects the rectangle is one pair of indices, alternating with a beginning index followed by an ending index.

If the stroke begins within the test rectangle, the first index is set to -1. If the stroke ends within the test rectangle, the last index is set to -1. If the stroke is wholly outside the test rectangle, an empty array is returned. For example, if a stroke begins inside the test rectangle, leaves the boundaries of the rectangle, returns inside, and leaves again, then the GetRectangleIntersections method might return {-1, 1.4, 5.5, 10.1} to describe the two segments of the stroke falling within the rectangle.


Minimum supported client Windows XP Tablet PC Edition [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header msinkaut.h
Library InkObj.dll

See also

Clip Method

FindIntersections Method

IInkStrokeDisp Interface