Midline Property [IInkRecognitionAlternate Interface]

Midline Property [IInkRecognitionAlternate Interface]

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

Declaration

[C++]

[C++]
[propget] HRESULT get_Midline ([out, retval] VARIANT* midline);

[Microsoft® Visual Basic® 6.0]

[Visual Basic]
Public Property Get Midline() 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 midline 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 midline parameter is an invalid pointer.
E_INK_EXCEPTION An exception occurred while processing.
E_INVALIDARG An invalid argument was passed to a recognizer of East Asian characters.
E_FAIL An alternate spans more than one line.

Remarks

The midline corresponds to an imaginary horizontal line with which the top of the main body of each character, excluding ascenders, is aligned. The midline also corresponds to the top 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 parallel to the baseline for the alternate. The distance of the midline above the baseline is determined by the corresponding distance within the first segment.

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 midline of a IInkRecognitionAlternate object, theRecognitionAlternate. The midline is a Variant containing an array of four Long values of the form x1, y1, x2, y2, where the points (x1, y1) and (x2, y2) describe the line in ink space coordinates. The Midline method will cause an error if the alternate occupies more than one line, so the error should be trapped and tested.

'...
Dim theMidline As Variant
On Error Resume Next
theMidline = theRecognitionAlternate.Midline

Applies To