游客已登陆 (0)未知
笔行证 257310
昵称 kuan 
笔贝 Score1
加为好友 发送短信
<< << 2008 十月 >> >>
1234
567891011
12131415161718
19202122232425
262728293031

访问计数:20964
本文:440 今天:1 本月 440

本地音乐播放器



 
       字体和CFont类
2007-07-10 晴



字体和CFont类
1,获得字体的信息.
为了准确显示文本,常常需要获得所选字体的信息.Windows用一个TEXTMETRIC结构类型的数据来存储字体的信息.
typedef struct tagTEXTMETRIC { /* tm */
int tmHeight;
int tmAscent;
int tmDescent;
int tmInternalLeading;
int tmExternalLeading;
int tmAveCharWidth;
int tmMaxCharWidth;
int tmWeight;
BYTE tmItalic;
BYTE tmUnderlined;
BYTE tmStruckOut;
BYTE tmFirstChar;
BYTE tmLastChar;
BYTE tmDefaultChar;
BYTE tmBreakChar;
BYTE tmPitchAndFamily;
BYTE tmCharSet;
int tmOverhang;
int tmDigitizedAspectX;
int tmDigitizedAspectY;
} TEXTMETRIC;



如果需要获得当前字体的信息,可以CDC类的成员
BOOL GetTextMetrics(LPTEXTMETRIC lpMetrics)const;
其中,参数lpMetrics是用用户定义的一个TEXTMETRIC结构类型数据指针.
TEXTMETRIC tm;
pDC->GetTextMetrics(&tm);

2字体的创建和CFont类




CClientDC类

CMetaFileDC类.
# posted by kuan @ 2007-07-10 12:18:26 评论(0)
 








 
笔 名:
*
评 论:
最多1000字。当前字数:0
*
联系方式: