- set text alignment
|| GfxSetTextAlign( align )
|| Sets the text-alignment flags.
The GfxTextOut function uses these flags when positioning a string of text on a display or device. The flags specify the relationship between a specific point and a rectangle that bounds the text. The coordinates of this point are passed as parameters to the TextOut member function. The rectangle that bounds the text is formed by the adjacent character cells in the text string.
Note: TA_ constants come from Windows API, they are given for reference only they are not predefined in AmiBroker, so you need to use numerical values.
- align - combination (binary-OR) of one or more the following flags:
- TA_CENTER = 6 - Aligns the point with the horizontal center of the bounding rectangle.
- TA_LEFT = 0 - Aligns the point with the left side of the bounding rectangle. This is the default setting.
- TA_RIGHT = 2 - Aligns the point with the right side of the bounding rectangle.
flags that determine whether the current position is updated when text is written:
- TA_BASELINE = 24 - Aligns the point with the base line of the chosen font.
- TA_BOTTOM = 8 - Aligns the point with the bottom of the bounding rectangle.
- TA_TOP = 0 - Aligns the point with the top of the bounding rectangle. This is the default setting.
- TA_NOUPDATECP = 0 - Does not update the current position after each call to a text-output function. This is the default setting.
- TA_UPDATECP = 1 - Updates the current x-position after each call to a text-output function. The new position is at the right side of the bounding rectangle for the text. When this flag is set, the coordinates specified in calls to the GfxTextOut member function are ignored
NOTE: This is LOW-LEVEL graphic function. To learn more about low-level
graphic functions please read TUTORIAL: Using low-level graphics.
|| GfxSetTextAlign( 6 | 24 ); // center and baseline alignment
|| GfxSetTextColor() function , GfxTextOut() function , GfxSetBkColor() function , GfxSetBkMode() function , GfxSelectFont() function
The GfxSetTextAlign function is used in the following formulas
in AFL on-line library:
See updated/extended version on-line.