InkAnalyzer.GetAlternates 方法 (Strokes, Int32)
針對指定的筆劃最多傳回指定的分析替代項目數。
命名空間: Microsoft.Ink
組件: Microsoft.Ink.Analysis (在 Microsoft.Ink.Analysis.dll 中)
語法
'宣告
Public Function GetAlternates ( _
strokes As Strokes, _
maximumAlternates As Integer _
) As AnalysisAlternateCollection
'用途
Dim instance As InkAnalyzer
Dim strokes As Strokes
Dim maximumAlternates As Integer
Dim returnValue As AnalysisAlternateCollection
returnValue = instance.GetAlternates(strokes, _
maximumAlternates)
public AnalysisAlternateCollection GetAlternates(
Strokes strokes,
int maximumAlternates
)
public:
AnalysisAlternateCollection^ GetAlternates(
Strokes^ strokes,
int maximumAlternates
)
public AnalysisAlternateCollection GetAlternates(
Strokes strokes,
int maximumAlternates
)
public function GetAlternates(
strokes : Strokes,
maximumAlternates : int
) : AnalysisAlternateCollection
參數
- strokes
型別:Microsoft.Ink.Strokes
要取得分析替代項目的筆劃。
- maximumAlternates
型別:System.Int32
要傳回的分析替代項目數。
傳回值
型別:Microsoft.Ink.AnalysisAlternateCollection
strokes 的頂端分析替代項目 (最多 maximumAlternates 個)。
備註
頂端替代項目會傳回做為集合的第一個替代項目。
strokes 中的 Stroke 物件不必表示文件的相鄰區域。
範例
這個範例針對與 InkAnalyzer (theInkAnalyzer) 相關聯的 Strokes (theStrokes),最多會取得五個頂端替代項目。接著會將替代項目的已辨識字串加入至 System.Collections.Specialized.StringCollection (theAlternateStrings)。
' Get 5 analysis alternates for the strokes collection and add the
' recognized string to a collection.
theAlternateCollection = Me.theInkAnalyzer.GetAlternates(theStrokes, 5)
theAlternateStrings.Clear()
Dim theAlternate As Microsoft.Ink.AnalysisAlternate
For Each theAlternate In theAlternateCollection
theAlternateStrings.Add(theAlternate.RecognizedString)
Next theAlternate
// Get 5 analysis alternates for the strokes collection and add the
// recognized string to a collection.
theAlternateCollection = this.theInkAnalyzer.GetAlternates(theStrokes, 5);
theAlternateStrings.Clear();
foreach (Microsoft.Ink.AnalysisAlternate theAlternate
in theAlternateCollection)
{
theAlternateStrings.Add(theAlternate.RecognizedString);
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0
請參閱
參考
Microsoft.Ink.AnalysisAlternate