您当前的位置: 首页 > 

令狐掌门

暂无认证

  • 2浏览

    0关注

    513博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

MFC修改控件字体大小

令狐掌门 发布时间:2020-02-29 22:51:32 ,浏览量:2

主要用到CreateFont,函数声明如下:

INGDIAPI HFONT   WINAPI CreateFontA( _In_ int cHeight, //字体高度:0为默认高度,非0绝对值为字体高度
                                    _In_ int cWidth,   //字体宽度
                                    _In_ int cEscapement,  //文本行的倾斜度
                                    _In_ int cOrientation, //字符基线的倾斜度
                                    _In_ int cWeight,  //字体的粗细
                                    _In_ DWORD bItalic, //字体是否为斜体
                             _In_ DWORD bUnderline,   //字体是否带下划线
                                    _In_ DWORD bStrikeOut,  //字体是否带删除线
                                    _In_ DWORD iCharSet,  //字体的字符集
                                    _In_ DWORD iOutPrecision,  //字符的输出精度
                                    _In_ DWORD iClipPrecision, //字符裁剪的精度
                             _In_ DWORD iQuality,  //字符的输出质量
                                    _In_ DWORD iPitchAndFamily, //字符间距和字体族(低位说明间距,高位说明字符族)
                                    _In_opt_ LPCSTR pszFaceName //字体名称
                                    );

代码示例:

CFont *m_Font;
m_Font = new CFont;
m_Font->CreateFont(20, 8, 0, 0, 60,
                   FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS,
                   CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_SWISS, "Arial");
m_NowTime.SetFont(m_Font, FALSE);
m_Status.SetFont(m_Font, FALSE);

 

关注
打赏
1652240117
查看更多评论
立即登录/注册

微信扫码登录

0.0623s