GeometryHitTestParameters Class
Collapse the table of content
Expand the table of content

GeometryHitTestParameters Class


Specifies a Geometry as the parameter to be used for hit testing a .GTMT

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)


public class GeometryHitTestParameters : HitTestParameters


Initializes a new instance of the GeometryHitTestParameters class, using the specified Geometry.


Gets the Geometry that defines the geometry for this GeometryHitTestParameters instance.GTMT


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Returns a string that represents the current object.(Inherited from Object.)

With the GeometryHitTestParameters class, you can use a Geometry value for hit testing, to determine whether any visual object intersects with the Geometry value.

You can also with a Point value by creating a PointHitTestParameters object.GTMT


Windows Presentation Foundation (WPF) hit testing only considers the filled area of a geometry during a hit test. If you create a point Geometry, the hit test would not intersect anything because a point has no area.

Legacy Code Example

The following example shows how to set up a hit test using GeometryHitTestParameters for the HitTest method. The Point value that is passed to the OnMouseDown method is used to create a Geometry object in order to expand the range of the hit test.

Code snippet is not found. Confirm that the code snippet name 'HitTestingOverview' is correct.

The IntersectionDetail property of GeometryHitTestResult provides information about the results of a hit test that uses a Geometry as a hit test parameter. The following illustration shows the relationship between the hit test geometry (the blue circle) and the target object (the red square).

Diagram of IntersectionDetail used in hit testing

Intersection between hit test geometry and target object

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
© 2015 Microsoft