RecognitionAlternate.GetStrokesFromStrokeRanges - метод
Обновлен: Ноябрь 2007
Returns the smallest Strokes collection that contains a known Strokes collection and for which the recognizer can provide alternates.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Function GetStrokesFromStrokeRanges ( _
s As Strokes _
) As Strokes
'Применение
Dim instance As RecognitionAlternate
Dim s As Strokes
Dim returnValue As Strokes
returnValue = instance.GetStrokesFromStrokeRanges(s)
public Strokes GetStrokesFromStrokeRanges(
Strokes s
)
public:
Strokes^ GetStrokesFromStrokeRanges(
Strokes^ s
)
public Strokes GetStrokesFromStrokeRanges(
Strokes s
)
public function GetStrokesFromStrokeRanges(
s : Strokes
) : Strokes
Параметры
- s
Тип: Microsoft.Ink.Strokes
The Strokes collection to use to find the smallest Strokes collection of the recognition result alternate that contains this collection.
Возвращаемое значение
Тип: Microsoft.Ink.Strokes
Returns the smallest Strokes collection that contains a known Strokes collection and for which the recognizer can provide alternates.
Заметки
The returned Strokes collection may match the input collection, or it may be larger if the input collection matches only part of the smallest recognition result that includes all of the input strokes.
This method is most useful for single-click word selection. For example, to return the strokes that make up the word you click, you can click a Stroke object, call the HitTest method of the Ink object to return that stroke, and then call GetStrokesFromStrokeRanges.
The stroke ranges are valid until the Ink object is modified.
Примеры
This C# example returns the Strokes collection that is associated with the smallest set of RecognitionAlternate objects that include the Strokes collection selected by clicking the mouse at ptMouseDown in the drawing space of Form1, where the ink strokes have been recognized and the result is in a RecognitionResult object, theRecognitionResult.
[C#]
Strokes hitStrokes;
Strokes altStrokes;
// Convert the mouse down to ink space coordinates
theInkCollector.Renderer.PixelToInkSpace(this.CreateGraphics(), ref ptMouseDown);
// Get the strokes hit by the mouse (within a radius of 100 HIMETRIC)
hitStrokes = theInkCollector.Ink.HitTest(ptMouseDown, 100);
if (hitStrokes.Count > 0)
{
altStrokes = theRecognitionResult.TopAlternate.GetStrokesFromStrokeRanges(hitStrokes);
//...
}
This Visual Basic .NET example returns the Strokes collection that is associated with the smallest set of RecognitionAlternate objects that include the Strokes collection selected by clicking the mouse at ptMouseDown in the drawing space of Form1, where the ink strokes have been recognized and the result is in a RecognitionResult object, theRecognitionResult.
[Visual Basic]
Dim hitStrokes As Strokes
Dim altStrokes As Strokes
' Convert the mouse down to ink space coordinates
theInkCollector.Renderer.PixelToInkSpace( _
Me.CreateGraphics(), ptMouseDown)
' Get the strokes hit by the mouse (within a radius of 100 HIMETRIC)
hitStrokes = theInkCollector.Ink.HitTest(ptMouseDown, 100)
If hitStrokes.Count > 0 Then
altStrokes = theRecognitionResult.TopAlternate.GetStrokesFromStrokeRanges( _
hitStrokes)
'...
End If
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0
См. также
Ссылки
Microsoft.Ink - пространство имен
RecognitionAlternate.GetStrokesFromTextRange