共用方式為


InkAnalyzer 建構函式 (Dispatcher)

使用特定的 Dispatcher 物件 (用來同步處理背景分析事件),初始化 InkAnalyzer 類別的新執行個體。

命名空間:  System.Windows.Ink
組件:  IAWinFX (在 IAWinFX.dll 中)

語法

'宣告
Public Sub New ( _
    synchronizingObject As Dispatcher _
)
'用途
Dim synchronizingObject As Dispatcher

Dim instance As New InkAnalyzer(synchronizingObject)
public InkAnalyzer(
    Dispatcher synchronizingObject
)
public:
InkAnalyzer(
    Dispatcher^ synchronizingObject
)
public InkAnalyzer(
    Dispatcher synchronizingObject
)
public function InkAnalyzer(
    synchronizingObject : Dispatcher
)

參數

範例

下列範例會建立新的 InkAnalyzer,並且將 StrokesChanged 事件處理常式附加至 InkCanvas (名為 theInkCanvas) 上的 Strokes 屬性。

theInkAnalyzer = New InkAnalyzer()

AddHandler theInkCanvas.Strokes.StrokesChanged, AddressOf Strokes_StrokesChanged
theInkAnalyzer = new InkAnalyzer();

theInkCanvas.Strokes.StrokesChanged += 
    new StrokeCollectionChangedEventHandler(Strokes_StrokesChanged);

下列範例會定義 Strokes_StrokesChanged 事件處理常式。如果筆劃已加入至 theInkCanvas,這個事件處理常式會將這些筆劃加入至 theInkAnalyzer。如果筆劃已從 theInkCanvas 移除,它也會將筆劃從 theInkAnalyzer 移除。

' This event occurs whenever a stroke is added, removed, or partially erased
' from the InkCanvas.
Sub Strokes_StrokesChanged(ByVal sender As Object, ByVal e As StrokeCollectionChangedEventArgs) 
    If e.Added.Count > 0 Then
        theInkAnalyzer.AddStrokes(e.Added)
    End If

    If e.Removed.Count > 0 Then
        theInkAnalyzer.RemoveStrokes(e.Removed)
    End If

End Sub 'Strokes_StrokesChanged
// This event occurs whenever a stroke is added, removed, or partially erased
// from the InkCanvas.
void Strokes_StrokesChanged(object sender, StrokeCollectionChangedEventArgs e)
{
    if (e.Added.Count > 0)
    {
        theInkAnalyzer.AddStrokes(e.Added);
    }

    if (e.Removed.Count > 0)
    {
        theInkAnalyzer.RemoveStrokes(e.Removed);
    }
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

InkAnalyzer 類別

InkAnalyzer 成員

InkAnalyzer 多載

System.Windows.Ink 命名空間

Ink