Compartilhar via


Baseline Property

Baseline Property

Gets the baseline line for a IInkRecognitionAlternate object that represents a single line of text.

Declaration

[C++]

[C++]
[propget] HRESULT get_Baseline ([out, retval] VARIANT* baseline);

[Microsoft® Visual Basic® 6.0]

[Visual Basic]
Public Property Get Baseline() As Variant

Property Value

VARIANT An array of type long of the form, x1, y1, x2, y2, where the points (x1, y1) and (x2, y2) describe the baseline in ink space coordinates for the IInkRecognitionAlternate object.

This property is read only.

For more information about the VARIANT structure, see Using the Automation Library.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER The baseline parameter is an invalid pointer.
E_FAIL Unspecific ink error. Can be caused by an alternate that spans more than one line.
E_INK_EXCEPTION An exception occurred while processing.
E_INVALIDARG An invalid argument was passed to a recognizer of East Asian characters.

Remarks

The baseline is the imaginary horizontal line with which the base of each character, excluding descenders, is aligned. It also corresponds to the bottom of the x-height.

Note: If the recognition alternate spans more than one recognition segment within a line of text, then this property returns a line that begins at the first point of the baseline of the first segment in the alternate and ends at the last point of the baseline of the last segment in the alternate.

You can use the AlternatesWithConstantPropertyValues method with the propertyType parameter set to the Segmentation recognition property globally unique identifier (GUID) to get a collection of one segment recognition alternates that correspond to a segmentation of your original alternate.

Note: If the recognition alternate spans more than one line, this property generates an E_FAIL error. You can use the LineAlternates property to get a collection of one line recognition alternates that corresponds to a multiple line recognition alternate.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example returns the baseline of an IInkRecognitionAlternate object, theRecognitionAlternate.

'...
Dim theBaseline(4) As Long
Dim i As Integer
On Error Resume Next
For i = 0 To 3
    theBaseline(i) = theRecognitionAlternate.Baseline(i)
Next
If Err.Number = &H80004005 Then         'E_FAIL
    MsgBox "the Alternate occupies more than one line."
Else
    ' Work with the Baseline data here
End If
'...

Applies To