DivisionUnit.Strokes Property
DivisionUnit.Strokes Property |
Gets the Strokes collection that was used to create the DivisionUnit object.
Definition
Visual Basic .NET Public ReadOnly Property Strokes As Strokes C# public Strokes Strokes { get; } Managed C++ public: __property Strokes* get_Strokes();
Property Value
Microsoft.Ink.Strokes. The Strokes collection that was used to create the DivisionUnit object.
This property is read-only. This property has no default value.
Remarks
This property contains a Strokes collection, which is the subset of the strokes in the DivisionResult object corresponding to a particular DivisionUnit object. You can pass these strokes to a separate RecognizerContext object to get a RecognitionResult for the DivisionUnit object.
Examples
[C#]
This C# example creates a Divider object, theDivider, which contains a Strokes collection, theStrokes, and uses a RecognizerContext object, theRecognizerContext. The Divide method is called to get a snapshot of the analysis results, theResult. The ResultByType method is called with the divisionType parameter set to Line to retrieve all of the line units within theResult. For each line, theLine, in the collection, the DivisionType, Strokes, RecognitionString, and Transform properties are retrieved.
// 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; }
[Visual Basic .NET]
This Microsoft® Visual Basic® .NET example creates a Divider object, theDivider, which contains a Strokes collection, theStrokes, and uses a RecognizerContext object, theRecognizerContext. The Divide method is called to get a snapshot of the analysis results, theResult. The ResultByType method is called with the divisionType parameter set to Line to retrieve all of the line units within theResult. For each line, theLine, in the collection, the DivisionType, Strokes, RecognitionString, and Transform properties are retrieved.
' 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
See Also