RecognitionAlternate.GetTextRangeFromStrokes 方法
确定识别文本 的最小范围,识别器 可以为该范围返回一个包含已知 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 方法,调用时在 theStrokes 中传入一个 Strokes 集合,该集合来自组成识别结果的笔画。
[C#]
// . . .
int theStart = 0;
int theLength = 0;
theRecognitionResult.TopAlternate.GetTextRangeFromStrokes(theStrokes, ref theStart, ref theLength);
// . . .
此 Visual Basic .NET 示例对 RecognitionResult 对象 theRecognitionResult 的 TopAlternate 属性调用 GetTextRangeFromStrokes 方法,调用时在 theStrokes 中传入一个 Strokes 集合,该集合来自组成识别结果的笔画。
[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