DivisionUnit.Strokes 屬性
取得用來建立 DivisionUnit 物件的 Strokes 集合。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public ReadOnly Property Strokes As Strokes
'用途
Dim instance As DivisionUnit
Dim value As Strokes
value = instance.Strokes
public Strokes Strokes { get; }
public:
property Strokes^ Strokes {
Strokes^ get ();
}
/** @property */
public Strokes get_Strokes()
public function get Strokes () : Strokes
屬性值
型別:Microsoft.Ink.Strokes
用來建立 DivisionUnit 物件的 Strokes 集合。
備註
這個屬性包含 Strokes 集合,它是對應至特定 DivisionUnit 物件之 DivisionResult 物件中筆劃的子集。您可以將這些筆劃傳遞至個別的 RecognizerContext 物件,以取得 DivisionUnit 物件的 RecognitionResult。
範例
這個 C# 範例會建立 Divider 物件 theDivider (其中包含 Strokes 集合 theStrokes),並且使用 RecognizerContext 物件 theRecognizerContext。它會呼叫 Divide 方法,以取得分析結果 theResult 的快照。呼叫 ResultByType 方法時會將 divisionType 參數設定為 Line (即 InkDivisionType 列舉型別),以擷取 theResult 中的所有行單位。針對集合中的每一行 (theLine),則會擷取 DivisionType、Strokes、RecognitionString 和 Transform 屬性。
// Create the Divider and assign a Strokes collection to it.
Divider theDivider = new Divider(theStrokes, theRecognizerContext);
// Retrieve the analysis result, and divide the result by line.
DivisionResult theResult = theDivider.Divide();
DivisionUnits theDivisionUnits =
theResult.ResultByType(InkDivisionType.Line);
foreach (DivisionUnit theLine in theDivisionUnits)
{
// For each line element in the collection
// retrieve the division type, the strokes,
// the recognition string, and the rotation transform.
InkDivisionType theDivisionType = theLine.DivisionType;
Strokes elementStrokes = theLine.Strokes;
string theRecognitionString = theLine.RecognitionString;
System.Drawing.Drawing2D.Matrix theInkTransform =
theLine.Transform;
}
這個 Microsoft® Visual Basic® .NET 範例會建立 Divider 物件 theDivider (其中包含 Strokes 集合 theStrokes),並且使用 RecognizerContext 物件 theRecognizerContext。它會呼叫 Divide 方法,以取得分析結果 theResult 的快照。呼叫 ResultByType 方法時會將 divisionType 參數設定為 Line (即 InkDivisionType 列舉型別),以擷取 theResult 中的所有行單位。針對集合中的每一行 (theLine),則會擷取 DivisionType、Strokes、RecognitionString 和 Transform 屬性。
' Create the Divider and assign a Strokes collection to it.
Dim theDivider As Divider = New Divider(theStrokes, theRecognizerContext)
' Retrieve the analysis result, and divide the result by line.
Dim theResult As DivisionResult = theDivider.Divide()
Dim theDivisionUnits As DivisionUnits = _
theResult.ResultByType(InkDivisionType.Line)
Dim theLine As DivisionUnit
For Each theLine In theDivisionUnits
' For each line element in the collection
' retrieve the division type, the strokes,
' the recognition string, and the rotation transform.
Dim theDivisionType As InkDivisionType = theLine.DivisionType
Dim elementStrokes As Strokes = theLine.Strokes
Dim theRecognitionString As String = theLine.RecognitionString
Dim theInkTransform As System.Drawing.Drawing2D.Matrix = _
theLine.Transform
Next
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0