RecognitionAlternate.GetStrokesFromTextRange - метод
Обновлен: Ноябрь 2007
Returns the Strokes collection that corresponds to the smallest set of recognition segment that contains a specified character range within the alternate.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Function GetStrokesFromTextRange ( _
ByRef selectionStart As Integer, _
ByRef selectionLength As Integer _
) As Strokes
'Применение
Dim instance As RecognitionAlternate
Dim selectionStart As Integer
Dim selectionLength As Integer
Dim returnValue As Strokes
returnValue = instance.GetStrokesFromTextRange(selectionStart, _
selectionLength)
public Strokes GetStrokesFromTextRange(
ref int selectionStart,
ref int selectionLength
)
public:
Strokes^ GetStrokesFromTextRange(
int% selectionStart,
int% selectionLength
)
public Strokes GetStrokesFromTextRange(
/** @ref */int selectionStart,
/** @ref */int selectionLength
)
public function GetStrokesFromTextRange(
selectionStart : int,
selectionLength : int
) : Strokes
Параметры
- selectionStart
Тип: System.Int32%
The start of the character range within this alternate.
- selectionLength
Тип: System.Int32%
The length of the character range within the alternate. This parameter must be greater than 0. This parameter is adjusted to the length of the smallest set of one or more segments that includes the input selection.
Возвращаемое значение
Тип: Microsoft.Ink.Strokes
Returns the Strokes collection that corresponds to the smallest set of recognition segments that contains a specified character range within the alternate.
Заметки
The character at the selectionStart position is included in the range of recognized text. This parameter is adjusted to the beginning of the smallest recognized set of one or more segments that includes the input selection. The selectionStart parameter is a zero-based index into the characters in the recognition alternate's text.
Consider a Strokes collection that has been recognized and for which the best alternate is "how are you". The parameter passed to this method is some range within (or possibly all of) this string result. This alternate contains five segments, one for each word and one for each space. The strokes returned correspond to the smallest set of segments that include all of the input range. If the selectionStart parameter is 0, and the selectionLength parameter is 5, creating a range corresponding to the "how a" of the result string, then the strokes returned are all of the recognized strokes that make up the segments "how are". This is the smallest set of segments that includes the input range.
In both word-based and character-based recognizers, spaces are counted as a character. If the input selection corresponds to a space character, then this method returns an empty Strokes collection.
Примеры
This C# example finds the Strokes collection, altStrokes, associated with the smallest set of RecognitionAlternate objects that include the text range.
[C#]
theTextBox.Text = theRecognitionResult.TopString;
//... Assume the user has selected a range within theTextBox.
int selStart = theTextBox.SelectionStart;
int selLength = theTextBox.SelectionLength;
Strokes altStrokes;
altStrokes = theRecognitionResult.TopAlternate.GetStrokesFromTextRange(
ref selStart, ref selLength);
This Microsoft® Visual Basic® .NET example finds the Strokes collection, altStrokes, associated with the smallest set of RecognitionAlternate objects that include the text range.
[Visual Basic]
theTextBox.Text = theRecognitionResult.TopString
'... Assume the user has selected a range within theTextBox.
Dim selStart As Integer = theTextBox.SelectionStart
Dim selLength As Integer = theTextBox.SelectionLength
Dim altStrokes As Strokes
altStrokes = theRecognitionResult.TopAlternate.GetStrokesFromTextRange( _
selStart, selLength)
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0
См. также
Ссылки
Microsoft.Ink - пространство имен
RecognitionAlternate.GetStrokesFromStrokeRanges