Freigeben über


Ink.NearestPoint Method

Ink.NearestPoint Method

Returns the Stroke object within the Ink object that is nearest to a specified Point Leave Site, given in ink space coordinates.

Definition

Visual Basic .NET Public Function NearestPoint( _
ByVal point As Point _
) As Stroke
C# public Stroke NearestPoint(
Point point
);
Managed C++ public: Stroke* NearestPoint(
Point *point
);

Parameters

point System.Drawing.Point. The specified point within the Ink object, given in ink space coordinates.

Return Value

Microsoft.Ink.Stroke. Returns the Stroke that contains a Point Leave Site that is closest to the specified point in the Ink object. If more than one stroke contains a Point Leave Site that is the same distance from the known Point Leave Site, the value of this result is arbitrary.

Exceptions

ObjectDisposedException Leave Site: The Ink object is disposed.

Examples

[C#]

This C# example returns the nearest Stroke object, theNearestStroke, to a known Point Leave Site, ptInk, which is given in ink space coordinates.

Stroke theNearestStroke = theInkCollector.Ink.NearestPoint(ptInk);

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example returns the nearest Stroke object, theNearestStroke, to a known Point Leave Site, ptInk, which is given in ink space coordinates.

Dim theNearestStroke As Stroke = theInkCollector.Ink.NearestPoint(ptInk)

See Also