表示單一辨識作業的 ContextNode。CustomRecognizerNode 物件下儲存的所有筆劃和節點都是在一個獨立的辨識作業中辨識的,而且 InkAnalyzer 不會分析這些筆劃和節點。
命名空間: System.Windows.Ink
組件: IAWinFX (在 IAWinFX.dll 中)
語法
'宣告
Public NotInheritable Class CustomRecognizerNode _
Inherits ContextNode
'用途
Dim instance As CustomRecognizerNode
public sealed class CustomRecognizerNode : ContextNode
public ref class CustomRecognizerNode sealed : public ContextNode
public final class CustomRecognizerNode extends ContextNode
public final class CustomRecognizerNode extends ContextNode
備註
CustomRecognizerNode 物件可以包含 RootNode 以外的任何 ContextNode 型別。CustomRecognizerNode 物件必須是 RootNode 的直接子系。
建立自訂辨識器的最簡單方式,是使用 InkAnalyzer.CreateCustomRecognizer 建立辨識器並使用 InkAnalyzerAddStrokesToCustomRecognizer(StrokeCollection, ContextNode) 將筆劃指派給它。如果您所加入的任何筆劃都已經指派給 InkAnalyzer 內容樹狀目錄中的任何節點 (包括 UnclassifiedInkNode),則會擲回 ArgumentException。為了避免這種狀況,將筆劃加入至自訂辨識器之前,請使用 InkAnalyzer.RemoveStroke 或 InkAnalyzer.RemoveStrokes,從 InkAnalyzer 內容樹狀目錄中移除這些筆劃。
範例
下列範例會採用 Guid 當做名為 customRecognizerId 的自訂辨識器,並且用它建立 InkAnalyzer (名為 theInkAnalyzer) 的 CustomRecognizerNode。接著會從 StrokeCollection (strokesForCustomAnalysis) 加入筆劃。最後會呼叫 Analyze,將已辨識的字串放入 TextBox (theResultsTextBox)。
Dim customRecognizer As CustomRecognizerNode = _
theInkAnalyzer.CreateCustomRecognizer(customRecognizerId)
theInkAnalyzer.AddStrokesToCustomRecognizer(strokesForCustomAnalysis, customRecognizer)
Dim theStatus As AnalysisStatus = theInkAnalyzer.Analyze()
theResultsTextBox.Text = customRecognizer.GetRecognizedString()
CustomRecognizerNode customRecognizer =
theInkAnalyzer.CreateCustomRecognizer(customRecognizerId);
theInkAnalyzer.AddStrokesToCustomRecognizer(strokesForCustomAnalysis, customRecognizer);
AnalysisStatus theStatus = theInkAnalyzer.Analyze();
theResultsTextBox.Text = customRecognizer.GetRecognizedString();
繼承階層架構
System.Object
System.Windows.Ink.ContextNode
System.Windows.Ink.CustomRecognizerNode
執行緒安全
這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0