Freigeben über


FindIntersections Method

FindIntersections Method

Returns the points where this IInkStrokeDisp object intersects other IInkStrokeDisp objects within a known InkStrokes collection.

Declaration

[C++]

HRESULT FindIntersections (
    [in] IInkStrokes* strokes,
    [out, retval] VARIANT *Intersections
);

[Microsoft® Visual Basic® 6.0]

Public Function FindIntersections( _
    strokes As InkStrokes _
) As Variant

Parameters

strokes

[in] Specifies the known collection of strokes that are used to calculate the points where this stroke intersects strokes in the collection. If NULL (Nothing in Visual Basic 6.0), use all strokes in the InkDisp object.

Note: The known collection of strokes must come from the same InkDisp object as the stroke being tested for intersection. If it is not from the same InkDisp object, E_INK_MISMATCHED_INK_OBJECT is returned (see "HRESULT value" below). The FindIntersections method is the only Tablet PC application programming interface (API) that requires that the known collection of strokes come from the same InkDisp object.

Intersections

[out, retval] returns an array of floating point index values that indicate the locations where this stroke intersects strokes within a known collection of strokes.

A floating point index is a float value that represents a location somewhere between two points in the stroke. As examples, if 0.0 is the first point in the stroke and 1.0 is the second point in the stroke, 0.5 is halfway between the first and second points. Similarly, a floating point index value of 37.25 represents a location that is 25 percent along the line between points 37 and 38 of the stroke.

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

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_OUTOFMEMORY Cannot allocate an IInkStrokeDisp handle helper object.
E_UNEXPECTED Unexpected parameter or property type.
E_INK_EXCEPTION An exception occurred inside the method.
E_INK_INCOMPATIBLE_OBJECT The IInkStrokes* parameter does not point to a compatible InkDisp object.
E_INK_MISMATCHED_INK_OBJECT The InkDisp object of the InkStrokes collection and this IInkStrokeDisp object don't match.

Remarks

This method can determine only the points of intersection.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example makes a copy of all of the intersections between the IInkStrokeDisp object, theStroke and the rest of the strokes in the InkDisp object, theInk.

Dim findexArray As Variant
findexArray = theStroke.FindIntersections(theInk.Strokes)

Applies To