Partager via


Stroke.HitTest Method

Stroke.HitTest Method

Returns a value that indicates whether a Stroke object is either completely inside or intersected by a given circle.

Definition

Visual Basic .NET Public Function HitTest( _
ByVal pt As Point, _
ByVal radius As Single _
) As Boolean
C# public bool HitTest(
Point pt,
float radius
);
Managed C++ public: bool* HitTest(
Point *pt,
float *radius
);

Parameters

pt System.Drawing.Point. The center of the hit test circle, in ink space coordinates.
radius System.Single. The radius of the hit test circle.

Return Value

System.Boolean. Whether a Stroke object is either completely inside or intersected by a given circle.

true The Stroke object is either completely inside or intersected by the circle.
false The Stroke object is completely outside the circle.

Examples

[C#]

This C# example returns a value that indicates whether any part of the Stroke object, theStroke, is within the distance, theRadius, of a Point Leave Site, thePoint, which is in ink space coordinates.

bool isAHit = theStroke.HitTest(thePt, theRadius);
                

[VB.NET]

This Microsoft® Visual Basic® .NET example returns a value that indicates whether any part of the Stroke object, theStroke, is within the distance, theRadius, of a Point Leave Site, thePoint, which is in ink space coordinates.

Dim isAHit As Boolean = theStroke.HitTest(thePt, theRadius)
                

See Also