IInkStrokeDisp::GetRectangleIntersections method (msinkaut.h)

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

Syntax

HRESULT GetRectangleIntersections(
  [in]          IInkRectangle *Rectangle,
  [out, retval] VARIANT       *Intersections
);

Parameters

[in] Rectangle

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

[out, retval] Intersections

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
S_OK
Success.
E_POINTER
A parameter contained an invalid pointer.
E_OUTOFMEMORY
Cannot allocate Stroke handler helper object.
E_UNEXPECTED
Unexpected parameter or property type.
E_INK_EXCEPTION
An exception occurred inside the method.

Remarks

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.

Requirements

Requirement Value
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