Compartilhar via


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 value Description
S_OK Success.
E_INK_EXCEPTION An exception occurred inside the method.
E_INVALIDARG The parameter is an invalid pointer.
E_OUTOFMEMORY Cannot allocate memory to complete the operation.
E_POINTER Invalid parameter memory.
E_UNEXPECTED Unexpected parameter or property type.
TPC_E_OUT_OF_ORDER_CALL This 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