网站首页  词典首页

请输入您要查询的函数:

 

术语 gettextalign
释义 GetTextAlign
语法:
UINT GetTextAlign(
__in HDC hdc
);
GetTextAlign功能
该GetTextAlign函数检索指定的设备上下文的文本对齐设置。
参数
hdc [in]
一个句柄,设备上下文。
返回值
如果函数成功,返回值是文本的地位对准标志。如需有关返回值的信息,请参见备注部分。返回值是下列值的组合。
ValueMeaning
TA_BASELINEThe参考点是对文本的底线。
TA_BOTTOMThe参考点是对边界矩形的底部边缘。
TA_TOPThe参考点是对边界矩形的上边缘。
TA_CENTERThe参考点是一致的Level与边界矩形中心。
TA_LEFTThe参考点是对边界矩形的左边缘。
TA_RIGHTThe参考点是对边界矩形的右边缘。
TA_RTLREADINGMiddle东亚语言版本的Windows:该文本规定从右到左的阅读顺序进行,而不是默认的从左到右的顺序。这仅适用于当字体到设备上下文选择要么是希伯来文或阿拉伯文。
TA_NOUPDATECPThe当前的位置是不会更新后,每个文本的输出要求。
TA_UPDATECPThe当前的位置是在每次更新文本输出要求。
当电流字体有一个垂直的默认底线(与汉字),以下值被用来代替TA_BASELINE和TA_CENTER。
ValueMeaning
VTA_BASELINEThe参考点是对文本的底线。
VTA_CENTERThe参考点是垂直排列的边界矩形的中心。
如果函数失败,返回值是GDI_ERROR。
备注
边界矩形是矩形边框在一个文本字符串字符的所有单元格。其尺寸可通过调用GetTextExtentPoint32功能。
文本对齐标志确定如何TextOut和ExtTextOut职能的调整与字符串的参考点提供TextOut或ExtTextOut文本字符串。
文本对齐标志不一定单位标志,并可能等于零。该标志必须经有关国旗的群体,如下面的列表中显示。
TA_LEFT,TA_RIGHT和TA_CENTER
TA_BOTTOM,TA_TOP和TA_BASELINE
TA_NOUPDATECP和TA_UPDATECP
如果当前的字体有一个垂直默认的基本路线,相关标志,如下面的列表中显示。
TA_LEFT,TA_RIGHT和VTA_BASELINE
TA_BOTTOM,TA_TOP和VTA_CENTER
TA_NOUPDATECP和TA_UPDATECP
要验证一个特定的标志是在这个函数的返回值设置:
应用位或营办商向国旗和相关标志。
应用位AND运算符的结果,返回值。
试验这一结果平等和标志。
实例
有关示例,请参见设置文本对齐。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
字体和文字概述
字体和文本函数
ExtTextOut
GetTextExtentPoint32
SetTextAlign
TextOut
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetTextAlign Function
The GetTextAlign function retrieves the text-alignment setting for the specified device context.
Syntax
UINT GetTextAlign(
__in HDC hdc
);
Parameters
hdc [in]
A handle to the device context.
Return Value
If the function succeeds, the return value is the status of the text-alignment flags. For more information about the return value, see the Remarks section. The return value is a combination of the following values.
ValueMeaning
TA_BASELINEThe reference point is on the base line of the text.
TA_BOTTOMThe reference point is on the bottom edge of the bounding rectangle.
TA_TOPThe reference point is on the top edge of the bounding rectangle.
TA_CENTERThe reference point is aligned horizontally with the center of the bounding rectangle.
TA_LEFTThe reference point is on the left edge of the bounding rectangle.
TA_RIGHTThe reference point is on the right edge of the bounding rectangle.
TA_RTLREADINGMiddle East language edition of Windows: The text is laid out in right to left reading order, as opposed to the default left to right order. This only applies when the font selected into the device context is either Hebrew or Arabic.
TA_NOUPDATECPThe current position is not updated after each text output call.
TA_UPDATECPThe current position is updated after each text output call.

When the current font has a vertical default base line (as with Kanji), the following values are used instead of TA_BASELINE and TA_CENTER.
ValueMeaning
VTA_BASELINEThe reference point is on the base line of the text.
VTA_CENTERThe reference point is aligned vertically with the center of the bounding rectangle.

If the function fails, the return value is GDI_ERROR.
Remarks
The bounding rectangle is a rectangle bounding all of the character cells in a string of text. Its dimensions can be obtained by calling the GetTextExtentPoint32 function.
The text-alignment flags determine how the TextOut and ExtTextOut functions align a string of text in relation to the string's reference point provided to TextOut or ExtTextOut.
The text-alignment flags are not necessarily single bit flags and may be equal to zero. The flags must be examined in groups of related flags, as shown in the following list.
TA_LEFT, TA_RIGHT, and TA_CENTER
TA_BOTTOM, TA_TOP, and TA_BASELINE
TA_NOUPDATECP and TA_UPDATECP
If the current font has a vertical default base line, the related flags are as shown in the following list.
TA_LEFT, TA_RIGHT, and VTA_BASELINE
TA_BOTTOM, TA_TOP, and VTA_CENTER
TA_NOUPDATECP and TA_UPDATECP
To verify that a particular flag is set in the return value of this function:
Apply the bitwise OR operator to the flag and its related flags.
Apply the bitwise AND operator to the result and the return value.
Test for the equality of this result and the flag.
Examples
For an example, see Setting the Text Alignment .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Fonts and Text Overview
Font and Text Functions
ExtTextOut
GetTextExtentPoint32
SetTextAlign
TextOut
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144932(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2025/1/9 4:21:50