RecognitionAlternate.GetTextRangeFromStrokes Method
Determines the smallest range of recognized text for which the recognizer can return an alternate that contains a known Strokes collection.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public Sub GetTextRangeFromStrokes ( _
s As Strokes, _
ByRef selectionStart As Integer, _
ByRef selectionLength As Integer _
)
'Usage
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 function GetTextRangeFromStrokes(
s : Strokes,
selectionStart : int,
selectionLength : int
)
Parameters
s
Type: Microsoft.Ink.StrokesThe Strokes collection contained within the alternate.
selectionStart
Type: System.Int32%The start position of the range of recognized text.
selectionLength
Type: System.Int32%The length of the range of recognized text.
Remarks
Use this method to retrieve the text that corresponds to a specified range of Stroke objects. For example, consider a Strokes collection, "how are you", that was drawn using nine strokes (one for each letter and three for each word). If a collection that consists of the sixth and seventh strokes is passed in, corresponding to characters "e" and "y", the text range returned matches the alternate containing "are you" and the selection start and length matches this substring.
Examples
This C# example calls the GetTextRangeFromStrokes method on the TopAlternate property of a RecognitionResult object, theRecognitionResult, passing in a Strokes collection from within the strokes that make up the recognition result in theStrokes.
[C#]
// . . .
int theStart = 0;
int theLength = 0;
theRecognitionResult.TopAlternate.GetTextRangeFromStrokes(theStrokes, ref theStart, ref theLength);
// . . .
This Visual Basic .NET example calls the GetTextRangeFromStrokes method on the TopAlternate property of a RecognitionResult object, theRecognitionResult, passing in a Strokes collection from within the strokes that make up the recognition result in theStrokes.
[Visual Basic]
' . . .
Dim theStart As Integer = 0
Dim theLength As Integer = 0
TheRecognitionResult.TopAlternate.GetTextRangeFromStrokes(theStrokes, _
theStart, theLength)
' . . .
Platforms
Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
RecognitionAlternate.GetStrokesFromStrokeRanges