PrefixText Property

PrefixText Property

Gets or sets the characters that come before the InkStrokes collection in the InkRecognizerContext object.

Declaration

[C++]



[propput] HRESULT put_PrefixText ([in] BSTR PrefixText);
[propget] HRESULT get_PrefixText (
    [out, retval] BSTR* PrefixText
);

      

[Microsoft® Visual Basic® 6.0]



Public Property Get PrefixText() As String
Public Property Let PrefixText( _
    ByVal thePrefixText As String)

      

Property Value

BSTR The characters that come before the InkStrokes collection in the InkRecognizerContext object. Must be less than 1k.

This property is read/write.

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

Return Value

HRESULT valueDescription
S_OKSuccess.
E_INK_EXCEPTIONAn exception occurred inside the method.
E_INVALIDARGThe parameter is an invalid pointer.
E_OUTOFMEMORYCannot allocate memory to complete the operation.
E_POINTERInvalid parameter memory.
E_UNEXPECTEDUnexpected parameter or property type.
TPC_E_OUT_OF_ORDER_CALLThis property cannot be assigned after strokes have been added to the Strokes property.

Remarks

The prefix helps improve recognition results by supplying the recognizer with more context about the handwriting.

Setting the PrefixText property succeeds only if the Strokes property is NULL (Nothing in Visual Basic 6.0). You must set the PrefixText property before you attach a InkStrokes collection to the Strokes property of the InkRecognizerContext, or you must set the Strokes property to NULL and then set the PrefixText property.

Note: If you use the latter method, you may need to reattach the InkStrokes collection to the Strokes property of the InkRecognizerContext object.

Setting the PrefixText property to NULL removes any prefix text from the recognizer context.

The prefix text is ignored unless you have set both the IRM_Coerce and IRM_WordMode InkRecognitionModes flags in the RecognitionFlags property.

The SuffixText property gets or sets the characters that come after the InkStrokes collection in the InkRecognizerContext object and also helps improve the recognition result.

If your application provides a correction interface when converting ink to text, the application may allow the user to select characters within a word and use the stylus to generate replacement characters. Your application can use the PrefixText and SuffixText properties to improve recognition of the new ink.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example returns the prefix text of the recognizer context.



Dim thePrefixText As String
thePrefixText = theRecognizerContext.PrefixText

      

Applies To

Related Topics

Show: