网站首页  词典首页

请输入您要查询的函数:

 

术语 gettextmetrics
释义 GetTextMetrics
语法:
BOOL GetTextMetrics(
__in HDC hdc,
__out LPTEXTMETRIC lptm
);
GetTextMetrics函数
该GetTextMetrics函数填充与当前选定字体的度量指定的缓冲区。
参数
hdc [in]
一个句柄,设备上下文。
lptm [out]
向TEXTMETRIC结构,接收文本数据的指针。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。
备注
要确定是否是一种字体TrueType字体,首先选择它成为一个区,然后调用GetTextMetrics,然后对TMPF_TRUETYPE检查TEXTMETRIC.tmPitchAndFamily。请注意,GetDC返回一个未初始化的直流电,这“系统”(1位图字体)作为默认的字体,因此有必要选择一到直流字体。
实例
有关示例,请参见“显示键盘输入”的使用键盘输入或利用来自同一行不同的字体文本。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
Unicode和ANSI namesGetTextMetricsW(Unicode)和GetTextMetricsA(ANSI)的
参见
字体和文字概述
字体和文本函数
GetTextAlign
GetTextExtentPoint32
GetTextFace
SetTextJustification
TEXTMETRIC
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetTextMetrics Function
The GetTextMetrics function fills the specified buffer with the metrics for the currently selected font.
Syntax
BOOL GetTextMetrics(
__in HDC hdc,
__out LPTEXTMETRIC lptm
);
Parameters
hdc [in]
A handle to the device context.
lptm [out]
A pointer to the TEXTMETRIC structure that receives the text metrics.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks
To determine whether a font is a TrueType font, first select it into a DC, then call GetTextMetrics, and then check for TMPF_TRUETYPE in TEXTMETRIC.tmPitchAndFamily. Note that GetDC returns an uninitialized DC, which has "System" (a bitmap font) as the default font; thus the need to select a font into the DC.
Examples
For an example, see "Displaying Keyboard Input" in Using Keyboard Input or 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 namesGetTextMetricsW (Unicode) and GetTextMetricsA (ANSI)
See Also
Fonts and Text Overview
Font and Text Functions
GetTextAlign
GetTextExtentPoint32
GetTextFace
SetTextJustification
TEXTMETRIC
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144941(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:27:11