网站首页  词典首页

请输入您要查询的函数:

 

术语 drawtextex
释义 DrawTextEx
语法:
int DrawTextEx(
__in HDC hdc,
__inout LPTSTR lpchText,
__in int cchText,
__inout LPRECT lprc,
__in UINT dwDTFormat,
__in LPDRAWTEXTPARAMS lpDTParams
);
DrawTextEx Function
该DrawTextEx函数绘制格式化指定矩形的文本。
参数
hdc [in]
阿处理设备环境中得出。
lpchText [ in , out ]
一个字符串,包含文本绘制指针。如果cchText参数为-1,字符串必须是空终止。
如果dwDTFormat包括DT_MODIFYSTRING,功能可以增加额外的多达4个字符,此字符串。缓冲区包含字符串应该足够大,以容纳这些额外的字符。
cchText [in]
该字符串的长度指向lpchText。如果cchText为-1,则lpchText参数假定为一个空指针结尾的字符串和DrawTextEx字符数计算自动。
利比里亚炼油公司[ in , out ]
一个RECT结构,它包含矩形指针,在逻辑坐标,其中的文本被格式化。
dwDTFormat [in]
在格式选项。此参数可以是一个或多个下列值。
ValueMeaning
DT_BOTTOMJustifies到矩形的底部的文本。此值仅用于与DT_SINGLELINE价值。
DT_CALCRECTDetermines的宽度和高度的矩形。如果多行文本,DrawTextEx使用矩形的宽度指向的炼油公司参数和扩展了矩形基础的约束文本的最后一行。如果只有一行文本,DrawTextEx修改矩形的右侧,以便它在边界线的最后一个字符。在任何情况下,DrawTextEx返回格式化文本的高度,但不绘制文本。
DT_CENTERCenters文字Level的矩形。
DT_EDITCONTROLDuplicates的文本显示多行编辑控件的特点。具体来说,平均字符宽度的计算方法相同的方式,作为一个编辑控制,该函数不显示部分可见的最后一行。
DT_END_ELLIPSISFor显示的文本,取代了一个椭圆字符串的结尾这样的结果在指定的矩形适合。任何单词(不是在字符串的末尾),超出该矩形的限制没有被截断去省略号。该字符串不会修改,除非DT_MODIFYSTRING标志被指定。
比较DT_PATH_ELLIPSIS和DT_WORD_ELLIPSIS。
DT_EXPANDTABSExpands制表符。每个制表符的默认数量为8。
DT_EXTERNALLEADINGIncludes字体外部领导的高度一致。通常情况下,外部的领导是不包括在文本行的高度。
DT_HIDEPREFIXIgnores的符号在文本(&)前缀字符。这封信后面将不强调,但其他记忆前缀字符仍在处理中。
例如:
输入字符串:“急症年&D”类
正常:“小宝及d”
DT_HIDEPREFIX:“小宝及d”
比较DT_NOPREFIX和DT_PREFIXONLY。
DT_INTERNALUses系统字体来计算文本数据。
DT_LEFTAligns文本左。
DT_MODIFYSTRINGModifies指定的字符串匹配显示的文本。此值不会,除非DT_END_ELLIPSIS或DT_PATH_ELLIPSIS指定的效果。
DT_NOCLIPDraws未经剪辑。 DrawTextEx是稍快,使用时DT_NOCLIP。
DT_NOFULLWIDTHCHARBREAKPrevents在DBCS中换行符(双宽字符的字符串),使换行规则等同于半角字符串。例如,这可以用于在韩国的窗口,为更多的图标标签的可读性。此值,除非DT_WORDBREAK没有指定作用。
DT_NOPREFIXTurns过前缀字符的处理。通常情况下,DrawTextEx解释符号(&)助记前缀作为一项指令,强调如下的字符字符,双号(&)助记字头,作为指令,打印单个符号字符。通过指定DT_NOPREFIX,这种处理是关闭的。比较DT_HIDEPREFIX和DT_PREFIXONLY
DT_PATH_ELLIPSISFor显示的文本,替换在字符串中的字符椭圆以确保测试结果在指定的矩形适合。如果该字符串包含反斜杠(\\)字符,DT_PATH_ELLIPSIS尽可能保留的文本可能在最后反斜杠。该字符串不会修改,除非DT_MODIFYSTRING标志被指定。
比较DT_END_ELLIPSIS和DT_WORD_ELLIPSIS。
DT_PREFIXONLYDraws强调只有在以下的符(&)前缀字符的字符位置。不绘制字符串中的任何字符。
例如:
输入字符串:“急症年&D”类
正常:“小宝及d”
PREFIXONLY:“_”
比较DT_NOPREFIX和DT_HIDEPREFIX。
DT_RIGHTAligns文字的权利。
在从右到DT_RTLREADINGLayout左的阅读顺序为双向文本的字体时,将选定的HDC是希伯来文或阿拉伯文字体。所有文本的默认阅读顺序是从左向右的。
DT_SINGLELINEDisplays文本在一行只。回车符和换行符不断行。
DT_TABSTOPSets制表位。结构的DRAWTEXTPARAMS所指向lpDTParams参数指定每卡平均字符宽度数停止。
DT_TOPJustifies到矩形的顶部的文本。
DT_VCENTERCenters文本垂直。此值仅用于与DT_SINGLELINE价值。
DT_WORDBREAKBreaks话。线条自动断字与字之间,如果一个字延伸过去由炼油公司参数指定的矩形的边缘。阿回车换行符序列也打破了线。
DT_WORD_ELLIPSISTruncates任何词,并不适合在矩形,并增加了省略号。
比较DT_END_ELLIPSIS和DT_PATH_ELLIPSIS。
lpDTParams [in]
一个 DRAWTEXTPARAMS结构,指定其他格式的指针。此参数可以为NULL。
返回值
如果函数成功,返回值是逻辑单位文本的高度。如果DT_VCENTER或DT_BOTTOM被指定,返回值是从炼油公司失调“的顶部绘制的文本的下
如果函数失败,返回值是零。
备注
该DrawTextEx函数支持和方向,其纵均为零的字体。
该设备上下文文本对齐方式必须包括TA_LEFT,TA_TOP和TA_NOUPDATECP标志。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinuser.h(头文件:winuser.h)
LibraryUser32.lib
DLLUser32.dll
Unicode和ANSI namesDrawTextExW(Unicode)和DrawTextExA(ANSI)的
参见
字体和文字概述
字体和文本函数
DrawText
DRAWTEXTPARAMS
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==DrawTextEx Function
The DrawTextEx function draws formatted text in the specified rectangle.
Syntax
int DrawTextEx(
__in HDC hdc,
__inout LPTSTR lpchText,
__in int cchText,
__inout LPRECT lprc,
__in UINT dwDTFormat,
__in LPDRAWTEXTPARAMS lpDTParams
);
Parameters
hdc [in]
A handle to the device context in which to draw.
lpchText [in, out]
A pointer to the string that contains the text to draw. If the cchText parameter is -1, the string must be null-terminated.
If dwDTFormat includes DT_MODIFYSTRING, the function could add up to four additional characters to this string. The buffer containing the string should be large enough to accommodate these extra characters.
cchText [in]
The length of the string pointed to by lpchText. If cchText is -1, then the lpchText parameter is assumed to be a pointer to a null-terminated string and DrawTextEx computes the character count automatically.
lprc [in, out]
A pointer to a RECT structure that contains the rectangle, in logical coordinates, in which the text is to be formatted.
dwDTFormat [in]
The formatting options. This parameter can be one or more of the following values.
ValueMeaning
DT_BOTTOMJustifies the text to the bottom of the rectangle. This value is used only with the DT_SINGLELINE value.
DT_CALCRECTDetermines the width and height of the rectangle. If there are multiple lines of text, DrawTextEx uses the width of the rectangle pointed to by the lprc parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawTextEx modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawTextEx returns the height of the formatted text, but does not draw the text.
DT_CENTERCenters text horizontally in the rectangle.
DT_EDITCONTROLDuplicates the text-displaying characteristics of a multiline edit control. Specifically, the average character width is calculated in the same manner as for an edit control, and the function does not display a partially visible last line.
DT_END_ELLIPSISFor displayed text, replaces the end of a string with ellipses so that the result fits in the specified rectangle. Any word (not at the end of the string) that goes beyond the limits of the rectangle is truncated without ellipses. The string is not modified unless the DT_MODIFYSTRING flag is specified.
Compare with DT_PATH_ELLIPSIS and DT_WORD_ELLIPSIS.
DT_EXPANDTABSExpands tab characters. The default number of characters per tab is eight.
DT_EXTERNALLEADINGIncludes the font external leading in line height. Normally, external leading is not included in the height of a line of text.
DT_HIDEPREFIXIgnores the ampersand (&) prefix character in the text. The letter that follows will not be underlined, but other mnemonic-prefix characters are still processed.
Example:
input string: "A&bc&&d"
normal: "Abc&d"
DT_HIDEPREFIX: "Abc&d"
Compare with DT_NOPREFIX and DT_PREFIXONLY.
DT_INTERNALUses the system font to calculate text metrics.
DT_LEFTAligns text to the left.
DT_MODIFYSTRINGModifies the specified string to match the displayed text. This value has no effect unless DT_END_ELLIPSIS or DT_PATH_ELLIPSIS is specified.
DT_NOCLIPDraws without clipping. DrawTextEx is somewhat faster when DT_NOCLIP is used.
DT_NOFULLWIDTHCHARBREAKPrevents a line break at a DBCS (double-wide character string), so that the line-breaking rule is equivalent to SBCS strings. For example, this can be used in Korean windows, for more readability of icon labels. This value has no effect unless DT_WORDBREAK is specified.
DT_NOPREFIXTurns off processing of prefix characters. Normally, DrawTextEx interprets the ampersand (&) mnemonic-prefix character as a directive to underscore the character that follows, and the double-ampersand (&&) mnemonic-prefix characters as a directive to print a single ampersand. By specifying DT_NOPREFIX, this processing is turned off. Compare with DT_HIDEPREFIX and DT_PREFIXONLY
DT_PATH_ELLIPSISFor displayed text, replaces characters in the middle of the string with ellipses so that the result fits in the specified rectangle. If the string contains backslash (\\) characters, DT_PATH_ELLIPSIS preserves as much as possible of the text after the last backslash. The string is not modified unless the DT_MODIFYSTRING flag is specified.
Compare with DT_END_ELLIPSIS and DT_WORD_ELLIPSIS.
DT_PREFIXONLYDraws only an underline at the position of the character following the ampersand (&) prefix character. Does not draw any character in the string.
Example:
input string: "A&bc&&d"
normal: "Abc&d"
PREFIXONLY: " _ "
Compare with DT_NOPREFIX and DT_HIDEPREFIX.
DT_RIGHTAligns text to the right.
DT_RTLREADINGLayout in right-to-left reading order for bi-directional text when the font selected into the hdc is a Hebrew or Arabic font. The default reading order for all text is left-to-right.
DT_SINGLELINEDisplays text on a single line only. Carriage returns and line feeds do not break the line.
DT_TABSTOPSets tab stops. The DRAWTEXTPARAMS structure pointed to by the lpDTParams parameter specifies the number of average character widths per tab stop.
DT_TOPJustifies the text to the top of the rectangle.
DT_VCENTERCenters text vertically. This value is used only with the DT_SINGLELINE value.
DT_WORDBREAKBreaks words. Lines are automatically broken between words if a word extends past the edge of the rectangle specified by the lprc parameter. A carriage return-line feed sequence also breaks the line.
DT_WORD_ELLIPSISTruncates any word that does not fit in the rectangle and adds ellipses.
Compare with DT_END_ELLIPSIS and DT_PATH_ELLIPSIS.

lpDTParams [in]
A pointer to a DRAWTEXTPARAMS structure that specifies additional formatting options. This parameter can be NULL.
Return Value
If the function succeeds, the return value is the text height in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from lprc->top to the bottom of the drawn text
If the function fails, the return value is zero.
Remarks
The DrawTextEx function supports only fonts whose escapement and orientation are both zero.
The text alignment mode for the device context must include the TA_LEFT, TA_TOP, and TA_NOUPDATECP flags.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinuser.h (include Windows.h)
LibraryUser32.lib
DLLUser32.dll
Unicode and ANSI namesDrawTextExW (Unicode) and DrawTextExA (ANSI)
See Also
Fonts and Text Overview
Font and Text Functions
DrawText
DRAWTEXTPARAMS
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162499(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 更新时间:2024/10/6 11:32:28