Compartir a través de


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 void GetTextRangeFromStrokes (
    Strokes s, 
    /** @ref */ int selectionStart, 
    /** @ref */ int selectionLength
)
Not applicable.

Parameters

  • s
    The Strokes collection contained within the alternate.
  • selectionStart
    The start position of the range of recognized text.
  • selectionLength
    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.

Example

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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

RecognitionAlternate Class
RecognitionAlternate Members
Microsoft.Ink Namespace
RecognitionAlternate.GetStrokesFromStrokeRanges
RecognitionAlternate.GetStrokesFromTextRange
Strokes