创建HFONT修改HFONT [英] Create modified HFONT from HFONT

查看:223
本文介绍了创建HFONT修改HFONT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Win32 API和C / C ++。我有一个HFONT,想用它来创建一个新的HFONT。新的字体应该使用,除了它应该大胆完全相同的字体规格。是这样的:

I using the Win32 API and C/C++. I have a HFONT and want to use it to create a new HFONT. The new font should use the exact same font metrics except that it should be bold. Something like:

HFONT CreateBoldFont(HFONT hFont) {
    LOGFONT lf;
    GetLogicalFont(hFont, &lf);
    lf.lfWeight = FW_BOLD;
    return CreateFontIndirect(&lf);
}

在GetLogicalFont是缺少API(据我可以告诉反正)。有一些其他的方式来做到这一点? preferrably的东西,在Windows Mobile 5 +工作。

The "GetLogicalFont" is the missing API (as far as I can tell anyway). Is there some other way to do it? Preferrably something that works on Windows Mobile 5+.

推荐答案

您想要使用的 GetObject函数

GetObject ( hFont, sizeof(LOGFONT), &lf );

这篇关于创建HFONT修改HFONT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆