网站首页  词典首页

请输入您要查询的函数:

 

术语 gettextextentpoint32
释义 GetTextExtentPoint32
语法:
BOOL GetTextExtentPoint32(
__in HDC hdc,
__in LPCTSTR lpString,
__in int c,
__out LPSIZE lpSize
);
GetTextExtentPoint32功能
该GetTextExtentPoint32函数计算宽度和文本的指定字符串的高度。
参数
hdc [in]
一个句柄,设备上下文。
lpString [in]
阿一个缓冲区,指定文本字符串指针。字符串不须空终止,因为C参数指定的字符串的长度。
? [in]
该字符串的长度指向lpString。
lpSize [out]
一个规模结构,它接收字符串的层面,逻辑单位,指针。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。
备注
该GetTextExtentPoint32函数使用当前选定的字体来计算字符串的尺寸。宽度和高度的逻辑单位,是计算不考虑任何剪辑。
由于某些设备克恩字符,人物的程度在字符串款额不等于字符串的程度。
计算字符串的宽度考虑到字符间的间隔由SetTextCharacterExtra职能和SetTextJustification规定的理由成立。这适用于既显示在屏幕上和打印。但是,如果lpDx是ExtTextOut设置,GetTextExtentPoint32不考虑任何字符间的间隔或理由。此外,电磁场,打印结果总是既考虑到字符间的间隔和理由。
当与在屏幕上显示的文字处理,计算出字符串的宽度考虑到字符间的间隔由SetTextCharacterExtra职能和SetTextJustification规定的理由成立。但是,如果lpDx是ExtTextOut设置,GetTextExtentPoint32不考虑任何字符间的间隔或理由。然而,当打印与电磁场:
结果忽略的印刷字符间的间隔,但GetTextExtentPoint32考虑到这一点。
打印结果考虑的理由,虽然GetTextExtentPoint32忽略它。
当返回文本的范围,此函数假定文本是Level的,那就是,纵始终为0。这是正确的,无论是文字Level和垂直测量。即使使用一种字体指定非零擒,此功能将不使用的角度,而计算的文字的程度。应用程序必须将它明确。
实例
有关示例,请参见利用来自同一行不同的字体文本。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
Unicode和ANSI namesGetTextExtentPoint32W(Unicode)和GetTextExtentPoint32A(ANSI)的
参见
字体和文字概述
字体和文本函数
ExtTextOut
SetTextCharacterExtra
SetTextJustification
尺寸
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetTextExtentPoint32 Function
The GetTextExtentPoint32 function computes the width and height of the specified string of text.
Syntax
BOOL GetTextExtentPoint32(
__in HDC hdc,
__in LPCTSTR lpString,
__in int c,
__out LPSIZE lpSize
);
Parameters
hdc [in]
A handle to the device context.
lpString [in]
A pointer to a buffer that specifies the text string. The string does not need to be null-terminated, because the c parameter specifies the length of the string.
c [in]
The length of the string pointed to by lpString.
lpSize [out]
A pointer to a SIZE structure that receives the dimensions of the string, in logical units.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks
The GetTextExtentPoint32 function uses the currently selected font to compute the dimensions of the string. The width and height, in logical units, are computed without considering any clipping.
Because some devices kern characters, the sum of the extents of the characters in a string may not be equal to the extent of the string.
The calculated string width takes into account the intercharacter spacing set by the SetTextCharacterExtra function and the justification set by SetTextJustification . This is true for both displaying on a screen and for printing. However, if lpDx is set in ExtTextOut , GetTextExtentPoint32 does not take into account either intercharacter spacing or justification. In addition, for EMF, the print result always takes both intercharacter spacing and justification into account.
When dealing with text displayed on a screen, the calculated string width takes into account the intercharacter spacing set by the SetTextCharacterExtra function and the justification set by SetTextJustification. However, if lpDx is set in ExtTextOut, GetTextExtentPoint32 does not take into account either intercharacter spacing or justification. However, when printing with EMF:
The print result ignores intercharacter spacing, although GetTextExtentPoint32 takes it into account.
The print result takes justification into account, although GetTextExtentPoint32 ignores it.
When returning the text extent, this function assumes that the text is horizontal, that is, that the escapement is always 0. This is true for both the horizontal and vertical measurements of the text. Even if using a font specifying a nonzero escapement, this function will not use the angle while computing the text extent. The application must convert it explicitly.
Examples
For an example, see Drawing Text from Different Fonts on the Same Line .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
Unicode and ANSI namesGetTextExtentPoint32W (Unicode) and GetTextExtentPoint32A (ANSI)
See Also
Fonts and Text Overview
Font and Text Functions
ExtTextOut
SetTextCharacterExtra
SetTextJustification
SIZE
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144938(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:28:43