Share via


RecognitionString Property

RecognitionString Property

Gets the recognized text for the InkStrokes collection in the IInkDivisionUnit object.

Declaration

[C++]

[C++]

[propget] HRESULT get_RecognizedString(
    [out,retval]BSTR *RecoString
);

      

[Microsoft® Visual Basic® 6.0]

[Visual Basic]

Public Property Get RecognizedString() As String

      

Property Value

BSTR The recognized text for the InkStrokes collection in the IInkDivisionUnit object or NULL (Nothing in Visual Basic 6.0) for drawing elements.

This property is read-only.

For more information about the BSTR data type, see Using the Automation Library.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contains an invalid pointer.
E_OUTOFMEMORY Unable to allocate memory to complete the operation.

Remarks

The following table describes the recognized text for each type of IInkDivisionUnit object.

DivisionUnit Type RecognizedText Value
IDT_Segment The top alternate for the recognition segment.
IDT_Line The RecognizedText for each segment in the line, separated by spaces.
IDT_Paragraph The RecognizedText for each line in the paragraph, separated by new line characters.
IDT_Drawing NULL.

The RecognitionString property and the DivisionUnit.ToString method return the identical strings.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example creates an InkDivider, theDivider, and assigns to it an InkStrokes collection, theStrokes, and a 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.RecognizedString
        Dim theInkTransform As InkTransform
        theInkTransform = theLine.RotationTransform
    Next
End If

Applies To