且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将图标添加到MFC功能区按钮

更新时间:2023-12-06 16:41:28

你有每个RibbonCategory只能使用一个文件的可能性。

You have the possibility to use only one file for each RibbonCategory.


  1. 创建你的png文件(例如32x256)

  1. Create your png file (32x256 for instance)

像资源一样添加文件

始终在资源视图中,选择RibbonCategory并设置大图像属性为您的PNG资源标识符(如IDB_MYMENU_PNG)。

Always in the Resource View, select your RibbonCategory and set the "Large Images" property to your PNG resource identifier (like IDB_MYMENU_PNG).

我也有很多使用bmp格式的问题(图像不可见,透明度被删除,...)这就是我推荐png格式的原因。

I also have many issues using bmp format (image not visible, transparency deleted, ...) that's why I recommand the png format.

为了在同一类别中使用原始图像和自定义图像,我创建了一个png文件是两者的合并。

In order to use original and custom images in the same category, I created a png file which is a merge of both.