DivisionType Property
DivisionType Property |
Returns the type of structural unit the IInkDivisionUnit object represents within the analysis results.
Declaration
[C++]
[propget] HRESULT get_divisionType(
[out,retval]InkDivisionType* divisionType
);
[Microsoft® Visual Basic® 6.0]
Public Property Get DivisionType() As InkDivisionType
Property Value
InkDivisionType The value that indicates the type of this IInkDivisionUnit object. The default value is IDT_Segment.
This property is read-only.
Return Value
HRESULT value | Description |
---|---|
S_OK | Success. |
E_POINTER | A parameter contains an invalid pointer. |
E_INK_EXCEPTION | An exception occurred inside the method. |
Example
[Visual Basic 6.0]
This Visual Basic 6.0 example creates an InkDivider, theDivider, and assigns to it an InkStrokes collection, theStrokes, and an InkRecognizerContext object, theRecognizerContext. The Divide method is called to get a snapshot of the analysis results, theResult. The ResultByType method is called with an InkDivisionType enumeration value of IDT_Line to retrieve all of the line units within theResult. If the collection of lines is not empty, then for each line, theLine, in the collection, the DivisionType, Strokes, RecognitionString, and RotationTransform properties are retrieved.
' Create the InkDivider and assign a strokes collection to it.
Dim theDivider As InkDivider
Set theDivider = New InkDivider
Set theDivider.ReconizerContext = theRecognizerContext
Set theDivider.Strokes = theStrokes
' Retrieve the analysis results, and get the first line.
Dim theResult As IInkDivisionResult
Set theResult = theDivider.Divide()
Dim theDivisionUnits As IInkDivisionUnits
Set theDivisionUnits = theResult.ResultByType(InkDivisionType.IDT_Line)
Dim theLine As IInkDivisionUnit
If Not (theDivisionUnits Is Nothing) Then
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
theDivisionType = theLine.DivisionType
Dim elementStrokes As InkStrokes
Set elementStrokes = theLine.Strokes
Dim theRecognitionString As String
theRecognitionString = theLine.RecognitionString
Dim theInkTransform As InkTransform
theInkTransform = theLine.RotationTransform
Next
End If