HitTestResult 클래스
정의
적중 횟수 테스트에서 반환 값을 나타내는 여러 파생 클래스에 대한 기본 클래스를 제공합니다.Provides the base class for several derived classes that represents the return value from a hit test.
public ref class HitTestResult abstract
public abstract class HitTestResult
type HitTestResult = class
Public MustInherit Class HitTestResult
- 상속
-
HitTestResult
- 파생
예제
다음 예제에서는 검색 하는 방법을 보여 줍니다 합니다 HitTestResult 의 값을 반환할는 HitTest 메서드.The following example shows how to retrieve the HitTestResult return value from the HitTest method.
// Respond to the left mouse button down event by initiating the hit test.
private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
// Retrieve the coordinate of the mouse position.
Point pt = e.GetPosition((UIElement)sender);
// Perform the hit test against a given portion of the visual object tree.
HitTestResult result = VisualTreeHelper.HitTest(myCanvas, pt);
if (result != null)
{
// Perform action on hit visual object.
}
}
' Respond to the left mouse button down event by initiating the hit test.
Private Overloads Sub OnMouseLeftButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
' Retrieve the coordinate of the mouse position.
Dim pt As Point = e.GetPosition(CType(sender, UIElement))
' Perform the hit test against a given portion of the visual object tree.
Dim result As HitTestResult = VisualTreeHelper.HitTest(myCanvas, pt)
If result IsNot Nothing Then
' Perform action on hit visual object.
End If
End Sub
설명
합니다 PointHitTestResult, GeometryHitTestResult, 및 RayHitTestResult 클래스에서 파생 HitTestResult합니다.The PointHitTestResult, GeometryHitTestResult, and RayHitTestResult classes derive from HitTestResult.
속성
VisualHit |
적중된 시각적 개체를 가져옵니다.Gets the visual object that was hit. |
메서드
Equals(Object) |
지정된 개체가 현재 개체와 같은지 확인합니다.Determines whether the specified object is equal to the current object. (다음에서 상속됨 Object) |
GetHashCode() |
기본 해시 함수로 작동합니다.Serves as the default hash function. (다음에서 상속됨 Object) |
GetType() |
현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance. (다음에서 상속됨 Object) |
MemberwiseClone() |
현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object. (다음에서 상속됨 Object) |
ToString() |
현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object. (다음에서 상속됨 Object) |