Ascender Property
Ascender Property |
Gets the ascender line for a IInkRecognitionAlternate object that represents a single line of text.
Declaration
[C++]
[C++]
[propget] HRESULT get_Ascender ([out, retval] VARIANT* ascender);
[Microsoft® Visual Basic® 6.0]
[Visual Basic]
Public Property Get Ascender() 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 ascender line 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 ascender 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
For western languages, the ascender corresponds to the portion of a lowercase letter that extends above the main body (the midline, or x-height) of that letter such as the vertical line of a "b" that extends above the highest point of the circle in that letter. The ascender line is the imaginary horizontal line across the top of the ascenders.
Note: If the recognition alternate spans more than one recognition segment within a line of text, then this property will return a line parallel to the baseline for the alternate. The distance of the ascender line 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 ascender line of an IInkRecognitionAlternate object, theRecognitionAlternate.
'...
Dim theAscender As Line
On Error Resume Next
Set theAscender = theRecognitionAlternate.Ascender
If Err.Number = &H80004005 Then 'E_FAIL
MsgBox "theRecognitionAlternate occupies more than one line."
Else
'Work with theAscender here
End If
'...