Stroke.HitTest Method (Point, Double)

Returns a value that indicates whether current Stroke intersects the specified area.

Namespace: System.Windows.Ink
Assembly: PresentationCore (in presentationcore.dll)

public bool HitTest (
	Point point,
	double diameter
public boolean HitTest (
	Point point, 
	double diameter
public function HitTest (
	point : Point, 
	diameter : double
) : boolean
You cannot use methods in XAML.



The Point that defines the center of the area to hit test.


The diameter of the area to hit test.

Return Value

true if the specified area intersects the current stroke; otherwise, false.

The following example changes the color of a Stroke if it intersects a certain area.

Point myPoint = new Point(100, 100);

if (myStroke.HitTest(myPoint, 10))
    myStroke.DrawingAttributes.Color = Colors.Red;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions