WORD SetTextAlign(hDC,wFlags)
This function sets the text-alignment flags for the given device context. The TextOut and ExtTextOut functions use 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 function. The rectangle that bounds the text is formed by the adjacent character cells in the text string.
Parameter | Type/Description |
hDC | HDC Identifies the device or display selected for text output. | |
wFlags | WORD Specifies a mask of the values in the following list. Only one flag may be chosen from those that affect horizontal and vertical alignment. In addition, only one of the two flags that alter the current position can be chosen: | |
Parameter | Type/Description |
Value | Meaning | ||
TA_BASELINE | Specifies alignment of the point and the baseline of the chosen font. | ||
TA_BOTTOM | Specifies alignment of the point and the bottom of the bounding rectangle. | ||
TA_CENTER | Specifies alignment of the point and the horizontal center of the bounding rectangle. | ||
TA_LEFT | Specifies alignment of the point and the left side of the bounding rectangle. | ||
TA_NOUPDATECP | Specifies that the current position is not updated after each TextOut or ExtTextOut function call. | ||
TA_RIGHT | Specifies alignment of the point and the right side of the bounding rectangle. | ||
TA_TOP | Specifies alignment of the point and the top of the bounding rectangle. | ||
TA_UPDATECP | Specifies that the current position is updated after each TextOut or ExtTextOut function call. | ||
The defaults are TA_LEFT, TA_TOP, and TA_NOUPDATECP. |
The return value specifies the previous text alignment setting; the low-order word contains the horizontal alignment, and the high-order word contains the vertical alignment.