GeometryHitTestResult.IntersectionDetail 속성

정의

적중 횟수 테스트의 IntersectionDetail 값을 가져옵니다.

public:
 property System::Windows::Media::IntersectionDetail IntersectionDetail { System::Windows::Media::IntersectionDetail get(); };
public System.Windows.Media.IntersectionDetail IntersectionDetail { get; }
member this.IntersectionDetail : System.Windows.Media.IntersectionDetail
Public ReadOnly Property IntersectionDetail As IntersectionDetail

속성 값

IntersectionDetail

적중 횟수 테스트의 IntersectionDetail 값입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 합니다 IntersectionDetail 속성의 GeometryHitTestResult합니다.

// Return the result of the hit test to the callback.
public HitTestResultBehavior MyHitTestResultCallback(HitTestResult result)
{
    // Retrieve the results of the hit test.
    IntersectionDetail intersectionDetail = ((GeometryHitTestResult)result).IntersectionDetail;

    switch (intersectionDetail)
    {
        case IntersectionDetail.FullyContains:

            // Add the hit test result to the list that will be processed after the enumeration.
            hitResultsList.Add(result.VisualHit);

            return HitTestResultBehavior.Continue;

        case IntersectionDetail.Intersects:

            // Set the behavior to return visuals at all z-order levels.
            return HitTestResultBehavior.Continue;

        case IntersectionDetail.FullyInside:

            // Set the behavior to return visuals at all z-order levels.
            return HitTestResultBehavior.Continue;

        default:
            return HitTestResultBehavior.Stop;
    }
}
' Return the result of the hit test to the callback.
Public Function MyHitTestResultCallback(ByVal result As HitTestResult) As HitTestResultBehavior
    ' Retrieve the results of the hit test.
    Dim intersectionDetail As IntersectionDetail = (CType(result, GeometryHitTestResult)).IntersectionDetail

    Select Case intersectionDetail
        Case IntersectionDetail.FullyContains

            ' Add the hit test result to the list that will be processed after the enumeration.
            hitResultsList.Add(result.VisualHit)

            Return HitTestResultBehavior.Continue

        Case IntersectionDetail.Intersects

            ' Set the behavior to return visuals at all z-order levels.
            Return HitTestResultBehavior.Continue

        Case IntersectionDetail.FullyInside

            ' Set the behavior to return visuals at all z-order levels.
            Return HitTestResultBehavior.Continue

        Case Else
            Return HitTestResultBehavior.Stop
    End Select
End Function

설명

합니다 IntersectionDetail 교차를 설명 하는 속성을 Geometry 및 대상 시각적 개체입니다.

다음 그림에서는 적중 횟수 테스트 기 하 도형 (파란색 원) 및 대상 개체 (빨간색 사각형) 간의 관계를 보여 줍니다.

적중 테스트에 사용되는 IntersectionDetail의 다이어그램
적중 횟수 테스트 기 하 도형 및 대상 개체의 교집합

적용 대상