ArcObjects Library Reference (Carto)  

IElement.HitTest Method

Indicates if the given x and y coordinates are contained by the element.

[Visual Basic .NET]
Public Function HitTest ( _
    ByVal x As Double, _
    ByVal y As Double, _
    ByVal Tolerance As Double _
) As Boolean
[C#]
public bool HitTest (
    double x,
    double y,
    double Tolerance
);
[C++]
HRESULT HitTest(
  double x,
  double y,
  double Tolerance,
  VARIANT_BOOL* hit
);
[C++]

Parameters

x [in]   x is a parameter of type double y [in]   y is a parameter of type double Tolerance [in]   Tolerance is a parameter of type double hit [out, retval]   hit is a parameter of type VARIANT_BOOL

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

HitTest returns a boolean value indicating whether or not the current element is intersected by the specified coordinate pair and tolerance distance.  For instance, if we have a line element selected, the HitTest is determining whether that line element is within the specified tolerance from the given X and Y.  A value of TRUE is returned if the element is within the tolerance, while FALSE is returned if it is not.

The X,Y, and tolerance values should be specified in map units.

 

See Also

IElement Interface