StrokeCollection.HitTest 메서드

정의

지정한 영역 내에 포함된 스트로크의 컬렉션을 반환합니다.

오버로드

HitTest(Rect, Int32)

지정한 사각형에서 길이가 지정한 비율 이상인 스트로크의 컬렉션을 반환합니다.

HitTest(Point, Double)

지정한 영역과 교차하는 스트로크의 컬렉션을 반환합니다.

HitTest(IEnumerable<Point>, StylusShape)

지정한 경로와 교차하는 스트로크의 컬렉션을 반환합니다.

HitTest(IEnumerable<Point>, Int32)

지정한 영역 내에서 길이가 지정한 비율 이상인 스트로크의 컬렉션을 반환합니다.

HitTest(Point)

지정한 점과 교차하는 스트로크의 컬렉션을 반환합니다.

HitTest(Rect, Int32)

지정한 사각형에서 길이가 지정한 비율 이상인 스트로크의 컬렉션을 반환합니다.

public:
 System::Windows::Ink::StrokeCollection ^ HitTest(System::Windows::Rect bounds, int percentageWithinBounds);
public System.Windows.Ink.StrokeCollection HitTest (System.Windows.Rect bounds, int percentageWithinBounds);
member this.HitTest : System.Windows.Rect * int -> System.Windows.Ink.StrokeCollection
Public Function HitTest (bounds As Rect, percentageWithinBounds As Integer) As StrokeCollection

매개 변수

bounds
Rect

적중 테스트를 수행할 범위를 지정하는 Rect입니다.

percentageWithinBounds
Int32

적중된 것으로 간주되기 위해 범위 내에 있어야 하는 스트로크의 최소 필수 길이입니다.

반환

StrokeCollection

StrokeCollection 내에서 지정한 비율 이상인 스트로크가 있는 Rect입니다.

예제

다음 예제에서는 범위 내에서 50% 이상 된 스트로크를 지웁니다는 Rect합니다. 이 예제에서는 있다고 가정를 InkPresenter 호출 presenter합니다.

Rect rect = new Rect(100, 100, 200, 200);
StrokeCollection strokes = presenter.Strokes.HitTest(rect, 50);

presenter.Strokes.Remove(strokes);
Dim rect As Rect = New Rect(100, 100, 200, 200)
Dim strokes As StrokeCollection = presenter.Strokes.HitTest(rect, 50)

presenter.Strokes.Remove(strokes)

적용 대상

HitTest(Point, Double)

지정한 영역과 교차하는 스트로크의 컬렉션을 반환합니다.

public:
 System::Windows::Ink::StrokeCollection ^ HitTest(System::Windows::Point point, double diameter);
public System.Windows.Ink.StrokeCollection HitTest (System.Windows.Point point, double diameter);
member this.HitTest : System.Windows.Point * double -> System.Windows.Ink.StrokeCollection
Public Function HitTest (point As Point, diameter As Double) As StrokeCollection

매개 변수

point
Point

적중 횟수 테스트에 대한 Point입니다.

diameter
Double

적중 테스트를 수행할 Point 주변 영역의 크기입니다.

반환

StrokeCollection

지정한 점과 교차하는 Stroke 개체의 컬렉션입니다.

예제

다음 예제에서는 지정 된 교차 하는 스트로크를 가져오는 방법을 Point합니다. 이 예제에서는 있다고 가정를 InkPresenter 호출 presenter합니다.

// Change the color of all the strokes at the specified position.
public void SelectStrokes(Point position)
{
    StrokeCollection selected = presenter.Strokes.HitTest(position, 5);

    foreach (Stroke s in selected)
    {
        s.DrawingAttributes.Color = Colors.Purple;
    }
}
' Change the color of all the strokes at the specified position.
Public Sub SelectStrokes(ByVal position As Point)

    Dim selected As StrokeCollection = presenter.Strokes.HitTest(position, 5)

    Dim s As Stroke
    For Each s In selected
        s.DrawingAttributes.Color = Colors.Purple
    Next s

End Sub

적용 대상

HitTest(IEnumerable<Point>, StylusShape)

지정한 경로와 교차하는 스트로크의 컬렉션을 반환합니다.

public:
 System::Windows::Ink::StrokeCollection ^ HitTest(System::Collections::Generic::IEnumerable<System::Windows::Point> ^ path, System::Windows::Ink::StylusShape ^ stylusShape);
public System.Windows.Ink.StrokeCollection HitTest (System.Collections.Generic.IEnumerable<System.Windows.Point> path, System.Windows.Ink.StylusShape stylusShape);
member this.HitTest : seq<System.Windows.Point> * System.Windows.Ink.StylusShape -> System.Windows.Ink.StrokeCollection
Public Function HitTest (path As IEnumerable(Of Point), stylusShape As StylusShape) As StrokeCollection

매개 변수

path
IEnumerable<Point>

적중 테스트를 수행할 경로를 나타내는 Point 형식의 배열입니다.

stylusShape
StylusShape

eraserPath의 모양을 지정하는 StylusShape입니다.

반환

StrokeCollection

path와 교차하는 스트로크의 StrokeCollection입니다.

예제

다음 예제에서는 모든 스트로크를 경로 교차 하 여 만든의 색을 변경 합니다 Point 배열입니다. 이 예제에서는 있다고 가정를 InkPresenter 호출 presenter합니다.

private void HitTestWithEraser(Point[] points)
{
    RectangleStylusShape eraser = new RectangleStylusShape(3, 3, 0);

    StrokeCollection strokes = presenter.Strokes.HitTest(points, eraser);

    foreach (Stroke s in strokes)
    {
        s.DrawingAttributes.Color = Colors.Purple;
    }
}
Private Sub HitTestWithEraser(ByVal points() As Point)
    Dim eraser As RectangleStylusShape = New RectangleStylusShape(3, 3, 0)

    Dim strokes As StrokeCollection = presenter.Strokes.HitTest(points, eraser)

    Dim s As Stroke
    For Each s In strokes
        s.DrawingAttributes.Color = Colors.Purple
    Next
End Sub

적용 대상

HitTest(IEnumerable<Point>, Int32)

지정한 영역 내에서 길이가 지정한 비율 이상인 스트로크의 컬렉션을 반환합니다.

public:
 System::Windows::Ink::StrokeCollection ^ HitTest(System::Collections::Generic::IEnumerable<System::Windows::Point> ^ lassoPoints, int percentageWithinLasso);
public System.Windows.Ink.StrokeCollection HitTest (System.Collections.Generic.IEnumerable<System.Windows.Point> lassoPoints, int percentageWithinLasso);
member this.HitTest : seq<System.Windows.Point> * int -> System.Windows.Ink.StrokeCollection
Public Function HitTest (lassoPoints As IEnumerable(Of Point), percentageWithinLasso As Integer) As StrokeCollection

매개 변수

lassoPoints
IEnumerable<Point>

적중 테스트를 수행할 영역의 범위를 나타내는 Point 형식의 배열입니다.

percentageWithinLasso
Int32

lassoPoints에 포함될 Stroke의 허용 가능한 길이이며 백분율로 표시됩니다.

반환

StrokeCollection

StrokeCollection 배열 내에서 지정한 비율 이상인 스트로크가 있는 Point입니다.

예외

lassoPoints이(가) null인 경우

또는 percentageWithinLasso이(가) null인 경우

lassoPoints에 빈 배열이 포함된 경우

percentageWithinLasso가 0보다 작거나 100보다 큽니다.

예제

다음 예제에서 지정한 올가미 내 80% 이상인 모든 스트로크를 제거 하는 방법에 설명 된 StrokeCollection합니다. 사용자 지정 컨트롤을 사용 하면을 올가미를 사용 하 여 잉크를 선택 하는 경우에 유용 합니다. 사용자는 올가미를 사용 하 여 잉크를 선택할 수 있는 컨트롤을 참조 하세요 방법: 사용자 지정 컨트롤에서 잉크 선택합니다.

// Remove the strokes within the lasso from the InkPresenter
public void RemoveStrokes(Point[] lasso)
{
    StrokeCollection strokes = presenter.Strokes.HitTest(lasso, 80);

    presenter.Strokes.Remove(strokes);
}
' Remove the strokes within the lasso from the InkPresenter
Public Sub RemoveStrokes(ByVal lasso As Point())

    If lasso Is Nothing Then
        Return
    End If

    Dim strokes As StrokeCollection = _
        presenter.Strokes.HitTest(lasso, 80)

    presenter.Strokes.Remove(strokes)

End Sub

적용 대상

HitTest(Point)

지정한 점과 교차하는 스트로크의 컬렉션을 반환합니다.

public:
 System::Windows::Ink::StrokeCollection ^ HitTest(System::Windows::Point point);
public System.Windows.Ink.StrokeCollection HitTest (System.Windows.Point point);
member this.HitTest : System.Windows.Point -> System.Windows.Ink.StrokeCollection
Public Function HitTest (point As Point) As StrokeCollection

매개 변수

point
Point

적중 테스트를 수행할 점입니다.

반환

StrokeCollection

지정한 점과 교차하는 Stroke 개체의 컬렉션입니다.

예제

다음 예제에서는 지정 된 교차 하는 스트로크를 가져오는 방법을 Point합니다. 이 예제에서는 있다고 가정를 InkPresenter 호출 presenter합니다.

// Change the color of all the strokes at the specified position.
public void SelectStrokes(Point position)
{
    StrokeCollection selected = presenter.Strokes.HitTest(position, 5);

    foreach (Stroke s in selected)
    {
        s.DrawingAttributes.Color = Colors.Purple;
    }
}
' Change the color of all the strokes at the specified position.
Public Sub SelectStrokes(ByVal position As Point)

    Dim selected As StrokeCollection = presenter.Strokes.HitTest(position, 5)

    Dim s As Stroke
    For Each s In selected
        s.DrawingAttributes.Color = Colors.Purple
    Next s

End Sub

적용 대상