网站首页  词典首页

请输入您要查询的函数:

 

术语 gettextextentexpoint
释义 GetTextExtentExPoint
语法:
BOOL GetTextExtentExPoint(
__in HDC hdc,
__in LPCTSTR lpszStr,
__in int cchString,
__in int nMaxExtent,
__out LPINT lpnFit,
__out LPINT alpDx,
__out LPSIZE lpSize
);
GetTextExtentExPoint功能
该GetTextExtentExPoint函数检索在指定的字符串,适合在一个特定的空间,并填补了与这些人物在每一个文本程度数组的字符数。 (阿文本的范围之间的空间与性格适合在太空开始的距离。)此信息是有用的字包装计算。
参数
hdc [in]
一个句柄,设备上下文。
lpszStr [in]
一个空指针结尾的字符串的程度要检索。
cchString [in]
在字符串中的字符数指向的lpszStr参数。对于一个ANSI调用它指定的字节字符串长度和一个Unicode它指定的文字字符串的长度。请注意,对于ANSI函数,在半角字符代码页采取每一个字节,而在DBCS代码页最字符需要两个字节;为Unicode的功能,大多数目前的定义Unicode字符(在基本多文种平面(BMP)的)这些都是一个字而Unicode代理人两个词。
nMaxExtent [in]
允许的最大宽度,以逻辑单位,在格式化字符串。
lpnFit [out]
一个整数,它接收的字符将适合由nMaxExtent参数指定的空间最大计数指针。当lpnFit参数为NULL,nMaxExtent参数被忽略。
alpDx [out]
对一个整数数组,接收部分字符串程度的指针。数组中的每个元素给出了距离,在逻辑单位之间的字符串的开始和一个人物适合由nMaxExtent参数指定的空间。此数组必须至少由cchString参数指定的字符的许多内容,因为整个数组内部使用。填充函数与数组的有效程度尽可能多字符由lpnFit参数指定。在数组的其他任何值应该被忽略。如果alpDx为NULL,该函数不计算部分字符串宽度。
对于复杂的脚本,其中一个字符序列可能是由一些代表的字形,在alpDx数组的值,但以lpnFit参数匹配一个指定的号码,以与代码点之一。同样,您应该忽视在alpDx数组中的值休息。
lpSize [out]
一个规模结构,它接收字符串的层面,逻辑单位,指针。这个参数不能为NULL。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。
备注
如果同时lpnFit和alpDx参数是NULL,调用GetTextExtentExPoint功能相当于调用GetTextExtentPoint功能。
为了GetTextExtentExPoint的lpDx阵列的ANSI版本的int值的数目和在lpString字节。 int值的对应一个DBCS字符的两个字节是每个整个综合性质的程度。
请注意,为GetTextExtentExPoint的alpDx值不相同,ExtTextOut的lpDx值。要使用lpDx的alpDx值,您必须先进程。
当返回文本的范围,此函数假定文本是Level的,那就是,纵始终为0。这是正确的,无论是文字Level和垂直测量。即使使用一种字体指定非零擒,此功能将不使用的角度,而计算的文字的程度。应用程序必须将它明确。
这个函数返回字符串中每个连续的性质。当这些四舍五入为逻辑单位,您就会得到比从GetCharWidth,它返回舍入到每个逻辑单元字符宽度返回不同的结果。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
Unicode和ANSI namesGetTextExtentExPointW(Unicode)和GetTextExtentExPointA(ANSI)的
参见
字体和文字概述
字体和文本函数
GetTextExtentPoint
尺寸
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetTextExtentExPoint Function
The GetTextExtentExPoint function retrieves the number of characters in a specified string that will fit within a specified space and fills an array with the text extent for each of those characters. (A text extent is the distance between the beginning of the space and a character that will fit in the space.) This information is useful for word-wrapping calculations.
Syntax
BOOL GetTextExtentExPoint(
__in HDC hdc,
__in LPCTSTR lpszStr,
__in int cchString,
__in int nMaxExtent,
__out LPINT lpnFit,
__out LPINT alpDx,
__out LPSIZE lpSize
);
Parameters
hdc [in]
A handle to the device context.
lpszStr [in]
A pointer to the null-terminated string for which extents are to be retrieved.
cchString [in]
The number of characters in the string pointed to by the lpszStr parameter. For an ANSI call it specifies the string length in bytes and for a Unicode it specifies the string length in WORDs. Note that for the ANSI function, characters in SBCS code pages take one byte each, while most characters in DBCS code pages take two bytes; for the Unicode function, most currently defined Unicode characters (those in the Basic Multilingual Plane (BMP)) are one WORD while Unicode surrogates are two WORDs.
nMaxExtent [in]
The maximum allowable width, in logical units, of the formatted string.
lpnFit [out]
A pointer to an integer that receives a count of the maximum number of characters that will fit in the space specified by the nMaxExtent parameter. When the lpnFit parameter is NULL, the nMaxExtent parameter is ignored.
alpDx [out]
A pointer to an array of integers that receives partial string extents. Each element in the array gives the distance, in logical units, between the beginning of the string and one of the characters that fits in the space specified by the nMaxExtent parameter. This array must have at least as many elements as characters specified by the cchString parameter because the entire array is used internally. The function fills the array with valid extents for as many characters as are specified by the lpnFit parameter. Any values in the rest of the array should be ignored. If alpDx is NULL, the function does not compute partial string widths.
For complex scripts, where a sequence of characters may be represented by any number of glyphs, the values in the alpDx array up to the number specified by the lpnFit parameter match one-to-one with code points. Again, you should ignore the rest of the values in the alpDx array.
lpSize [out]
A pointer to a SIZE structure that receives the dimensions of the string, in logical units. This parameter cannot be NULL.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks
If both the lpnFit and alpDx parameters are NULL, calling the GetTextExtentExPoint function is equivalent to calling the GetTextExtentPoint function.
For the ANSI version of GetTextExtentExPoint, the lpDx array has the same number of INT values as there are bytes in lpString. The INT values that correspond to the two bytes of a DBCS character are each the extent of the entire composite character.
Note, the alpDx values for GetTextExtentExPoint are not the same as the lpDx values for ExtTextOut . To use the alpDx values in lpDx, you must first process them.
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.
This function returns the extent of each successive character in a string. When these are rounded to logical units, you get different results than what is returned from the GetCharWidth , which returns the width of each individual character rounded to logical units.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
Unicode and ANSI namesGetTextExtentExPointW (Unicode) and GetTextExtentExPointA (ANSI)
See Also
Fonts and Text Overview
Font and Text Functions
GetTextExtentPoint
SIZE
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144935(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:29:12