決定辨識器可傳回替代項目 (含有已知的 Strokes 集合) 的最小文字辨識範圍。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public Sub GetTextRangeFromStrokes ( _
s As Strokes, _
ByRef selectionStart As Integer, _
ByRef selectionLength As Integer _
)
'用途
Dim instance As RecognitionAlternate
Dim s As Strokes
Dim selectionStart As Integer
Dim selectionLength As Integer
instance.GetTextRangeFromStrokes(s, selectionStart, _
selectionLength)
public void GetTextRangeFromStrokes(
Strokes s,
ref int selectionStart,
ref int selectionLength
)
public:
void GetTextRangeFromStrokes(
Strokes^ s,
int% selectionStart,
int% selectionLength
)
public void GetTextRangeFromStrokes(
Strokes s,
/** @ref */int selectionStart,
/** @ref */int selectionLength
)
public function GetTextRangeFromStrokes(
s : Strokes,
selectionStart : int,
selectionLength : int
)
參數
- s
型別:Microsoft.Ink.Strokes
替代項目內含的 Strokes 集合。
- selectionStart
型別:System.Int32%
文字辨識範圍的起始位置。
- selectionLength
型別:System.Int32%
文字辨識範圍的長度。
備註
這個方法可以用來擷取對應至 Stroke 物件之指定範圍的文字。以 Strokes 集合為例,使用九個筆劃繪製而成的 "how are you" (每個字母一個筆劃或每個字三個筆劃)。如果傳入一個由第六個和第七個筆劃構成的集合,對應至 "e" 和 "y" 字元的話,則傳回的文字範圍會符合含有 "are you" 的替代項目,而且選取的開頭和長度會符合這個子字串。
範例
這個 C# 範例會在 RecognitionResult 物件 (變數名稱為 theRecognitionResult) 的 TopAlternate 屬性上呼叫 GetTextRangeFromStrokes 方法,從構成辨識結果的筆劃內傳入 Strokes 集合至 theStrokes。
[C#]
// . . .
int theStart = 0;
int theLength = 0;
theRecognitionResult.TopAlternate.GetTextRangeFromStrokes(theStrokes, ref theStart, ref theLength);
// . . .
這個 Visual Basic .NET 範例會在 RecognitionResult 物件 (變數名稱為 theRecognitionResult) 的 TopAlternate 屬性上呼叫 GetTextRangeFromStrokes 方法,從構成辨識結果的筆劃內傳入 Strokes 集合至 theStrokes。
[Visual Basic]
' . . .
Dim theStart As Integer = 0
Dim theLength As Integer = 0
TheRecognitionResult.TopAlternate.GetTextRangeFromStrokes(theStrokes, _
theStart, theLength)
' . . .
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0
請參閱
參考
RecognitionAlternate.GetStrokesFromStrokeRanges