IncrementalLassoHitTester 类

定义

通过套索对 Stroke 进行动态命中测试。

public ref class IncrementalLassoHitTester : System::Windows::Ink::IncrementalHitTester
public class IncrementalLassoHitTester : System.Windows.Ink.IncrementalHitTester
type IncrementalLassoHitTester = class
    inherit IncrementalHitTester
Public Class IncrementalLassoHitTester
Inherits IncrementalHitTester
继承
IncrementalLassoHitTester

示例

以下示例演示如何在自定义控件中动态选择笔划。 有关整个示例,请参阅 如何:从自定义控件中选择墨迹

void selectionTester_SelectionChanged(object sender,
    LassoSelectionChangedEventArgs args)
{
    // Change the color of all selected strokes to red.
    foreach (Stroke selectedStroke in args.SelectedStrokes)
    {
        selectedStroke.DrawingAttributes.Color = Colors.Red;
        selectedStrokes.Add(selectedStroke);
    }

    // Change the color of all unselected strokes to 
    // their original color.
    foreach (Stroke unselectedStroke in args.DeselectedStrokes)
    {
        unselectedStroke.DrawingAttributes.Color = inkDA.Color;
        selectedStrokes.Remove(unselectedStroke);
    }
}
Private Sub selectionTester_SelectionChanged(ByVal sender As Object, _
    ByVal args As LassoSelectionChangedEventArgs)

    ' Change the color of all selected strokes to red.
    For Each selectedStroke As Stroke In args.SelectedStrokes
        selectedStroke.DrawingAttributes.Color = Colors.Red
        selectedStrokes.Add(selectedStroke)
    Next selectedStroke

    ' Change the color of all unselected strokes to 
    ' their original color.
    For Each unselectedStroke As Stroke In args.DeselectedStrokes
        unselectedStroke.DrawingAttributes.Color = inkDA.Color
        selectedStrokes.Remove(unselectedStroke)
    Next unselectedStroke

End Sub

注解

命中 IncrementalLassoHitTester 通过确定是否有套索路径包围它来测试笔划。 AddPoints使用触笔事件中的 方法将点添加到 IncrementalLassoHitTester。 当添加到 IncrementalLassoHitTester 的点选择或取消选择 时 Stroke,将 IncrementalLassoHitTester 引发 SelectionChanged 事件

属性

IsValid

获取 IncrementalHitTester 是否在进行命中测试。

(继承自 IncrementalHitTester)

方法

AddPoint(Point)

Point 中添加一个 IncrementalHitTester

(继承自 IncrementalHitTester)
AddPoints(IEnumerable<Point>)

IncrementalHitTester 添加点。

(继承自 IncrementalHitTester)
AddPoints(StylusPointCollection)

将指定的 StylusPoint 对象添加到 IncrementalHitTester 中。

(继承自 IncrementalHitTester)
AddPointsCore(IEnumerable<Point>)

IncrementalHitTester 添加点。

EndHitTesting()

释放由 IncrementalHitTester 使用的资源。

(继承自 IncrementalHitTester)
Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
OnSelectionChanged(LassoSelectionChangedEventArgs)

引发 SelectionChanged 事件。

ToString()

返回表示当前对象的字符串。

(继承自 Object)

事件

SelectionChanged

当套索路径选择或取消选择墨迹 Stroke 时发生。

适用于