勇芳软件工作室.汉化:  Fonts and Text > Fonts and Text Functions >

GetCharWidth32

Previous pageReturn to chapter overviewNext page

描述

 

GetCharWidth32函数以逻辑坐标检索当前字体在指定范围内的连续字符的宽度。

 

C++ 语法

 

BOOL GetCharWidth32(

__in  HDC hdc,

__in  UINT iFirstChar,

__in  UINT iLastChar,

__out LPINT lpBuffer

);

 

PowerBASIC 语法

 

FUNCTION GetCharWidth32A ( _

BYVAL hdc AS DWORD, _

BYVAL iFirstChar AS DWORD, _

BYVAL iLastChar AS DWORD, _

BYREF lpBuffer AS LONG _

) AS LONG

 

Unicode版本:

 

FUNCTION GetCharWidth32W ( _

BYVAL hdc AS DWORD, _

BYVAL iFirstChar AS DWORD, _

BYVAL iLastChar AS DWORD, _

BYREF lpBuffer AS LONG _

) AS LONG

 

参数

 

hdc

 

[in]处理设备上下文。

 

iFirstChar

 

[in]指定连续字符组中的第一个字符。

 

iLastChar

 

[in]指定连续字符组中的最后一个字符,不得超过指定的第一个字符。

 

lpBuffer

 

[out]指向以逻辑坐标接收字符宽度的缓冲区的指针。

 

返回值

 

如果函数成功,返回值不为零。

 

如果函数失败,返回值为零。

 

备注

 

GetCharWidth32不能在TrueType字体上使用。要检索TrueType字体的字符宽度,请使用GetCharABCWidths.

 

范围是包容性的也就是说,返回的宽度包括由iFirstChariLastChar参数指定的字符的宽度。

 

如果当前字体中不存在字符,则会分配默认字符的宽度。

 

引用文件 #INCLUDE Once

 

WinGdi.inc(包括Windows.inc)