次の方法で共有


RecognitionAlternate.GetStrokesFromStrokeRanges メソッド

既知の Strokes コレクションを含み、認識エンジンが代替候補を提供できる最小の Strokes コレクションを返します。

名前空間 :  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
    このコレクションを含む認識結果代替候補の最小の Strokes コレクションを見つけるために使用する Strokes コレクション。

戻り値

型 : Microsoft.Ink.Strokes
既知の Strokes コレクションを含み、認識エンジンが代替候補を提供できる最小の Strokes コレクションを返します。

解説

返される Strokes コレクションは入力コレクションに一致します。ただし、入力コレクションが、すべての入力ストロークを含む最小の認識結果の一部だけと一致する場合は、入力コレクションより大きくなります。

このメソッドは、シングルクリックによる単語の選択の場合に最も役立ちます。たとえば、クリックした単語で構成されるストロークを返すには、Stroke オブジェクトをクリックし、Ink オブジェクトの HitTest メソッドを呼び出してそのストロークを返し、GetStrokesFromStrokeRanges を呼び出します。

ストロークの範囲は、Ink オブジェクトが変更されるまで有効です。

この C# の例では、インク ストロークが認識されて、結果が RecognitionResult オブジェクト theRecognitionResult に格納された Form1 の描画領域の ptMouseDown の位置でマウスをクリックして Strokes コレクションを選択すると、そのコレクションを格納した RecognitionAlternate オブジェクトの最小セットに関連付けられている Strokes コレクションが返されます。

[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);
    //...
}

この Visual Basic .NET の例では、インク ストロークが認識されて結果が RecognitionResult オブジェクト theRecognitionResult に格納された Form1 の描画領域の ptMouseDown の位置でマウスをクリックして Strokes コレクションを選択すると、そのコレクションを格納した RecognitionAlternate オブジェクトの最小セットに関連付けられている Strokes コレクションが返されます。

[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

参照

参照

RecognitionAlternate クラス

RecognitionAlternate メンバ

Microsoft.Ink 名前空間

RecognitionAlternate.GetStrokesFromTextRange

RecognitionAlternate.GetTextRangeFromStrokes

Strokes