今天遇到了问题,网上down的

Here's how it works:

1. Create aCMFCRibbonButtonsGroup that will hold the status icon and add it to CMFCRibbonStatusBar

2. Create a CMFCToolBarImagesobject and add status icons via AddIcon() .

3. Register theCMFCToolbarImages to the RibbonButtonsGroup using SetImages() .For a status Icon, the pHotImages parameter may be set to NULL, since thebutton won't get a message handler assigned anyway. Note however, that both thefirst and the second parameter must be set. If the third is omitted, the iconwill be grayed out for disables buttons and if the first is omitted, no icons willbe displayed at all.

4. Create a new CMFCRibbonButtonand add it to the ButtonsGroup via AddButton() .Do *not* assign an Icon to it.

5. Obtain a pointer to thebutton using CMFCRibbonButtonsGroup::GetButton() .Then call CMFCRibbonButton::SetImageIndex() withthe appropriate index of the icon in the ToolBarImages object.

This approach works just fine,except for one minor detail: I was using 16x16 icons as status icons andnoticed that they get cropped on display to 16x15, i.e. the bottom row ofpixels is not displayed. A quick fix for this would be to specify the icon'sdimensions as 16x15 when callingLoadImage() ,but I wonder why this is necessary in the first place. I guess theCMFCRibbonButtonsGroup is to blame for this, though I don't know that classwell enough to claim anything for certain.

Edit:Turns out it really is CMFCToolBarImages's fault. For some reason, the defaulticon size here is 16x15. This can be changed by callingCMFCToolBarImages::SetImageSize() before adding the icons.

转载于:https://www.cnblogs.com/cyangyang/archive/2010/12/20/1912161.html

CMFCRibbonStatusBar中添加图片按钮相关推荐

  1. android添加图片按钮,如何给Android中的按钮添加图片功能

    在layout中建一个my_login.xml文件 代码如下 android:layout_width="fill_parent" android:layout_height=&q ...

  2. qsql 关联_QTableView与QSqlTableModel显示mysql数据库中的数据,怎么在QTableView的项中添加chekbox按钮与上拉列表啊真心求指导...

    QTableView与QSqlTableModel显示mysql数据库中的数据,如何在QTableView的项中添加chekbox按钮与下拉列表啊?真心求指导. 各位大侠好,利用QTableView与 ...

  3. 初次使用Android Studio问题,Android Studio往项目中添加图片

    2019独角兽企业重金招聘Python工程师标准>>> 习惯了iOS往项目中直接拖拽的图片的习性,第一次往Android Studio中添加图片为难了,怎么也拖拽不进去,为难了,研究 ...

  4. java 图片动画_java在窗口中添加图片做动画,怎么一闪一闪的?

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 视频来自:优酷 在java中添加图片做动画效果,怎么一闪一闪的运动啊?怎样才能让它不闪的连续运动呢? 下面是代码,代码项目project里有两个类,一个是 ...

  5. 【Github】怎么在README.md中添加图片?

    原理是将图片作为文档上传,在README.md中引用即可. 参考博客:[GitHub]给GitHub上的ReadMe.md文件中添加图片怎么做 . gitHub创建文件夹

  6. ag-grid 表格中添加图片

    ag-grid是一种非常好用的表格,网上搜索会有各种各样的基本用法,不过对于在ag-grid 表格中添加图片我没有找到方法,看了官方的文档,当然英文的自己也是靠网页翻译,最后发现有这么一个例子,我知道 ...

  7. html页面怎么添加打印,在网页中添加打印按钮或链接的方法

    在网页中添加打印按钮或链接的方法 发布时间:2020-05-27 17:38:35 来源:亿速云 阅读:347 作者:鸽子 打印按钮或链接是对网页的简单添加 CSS(层叠样式表)使你可以控制屏幕上的网 ...

  8. js layui跳转页面_layui自己添加图片按钮并点击跳转页面的例子

    1.按钮样式 2.定义按钮 layui.use('table', function(){ var table = layui.table; table.render({ elem: '#test' , ...

  9. iview在table中添加图片

    我们知道iview的table封装的太好,如果只是展示数据简直不要太简单,但是比如合并单元格就很麻烦,而我要做的是在table中添加图片 建议大家先看一下这个:https://www.iviewui. ...

最新文章

  1. C++ 笔记(13)— 函数(函数声明、函数定义、函数调用[传值、指针、引用]、函数参数默认值、函数重载)
  2. Asp.Net 使用 GDI+ 绘制3D饼图入门篇源码
  3. 题目1028:继续畅通工程
  4. 【控制】《鲁棒控制-线性矩阵不等式处理方法》-俞立老师-第11章-大系统的分散控制
  5. mysql列目录_mysql列直接存储图片路径
  6. 技巧 | 在R语言中使用高德地图的API进行地理/逆地理编码(地址与经纬度的相互转换)...
  7. 让cat命令有颜色得输出文件(ccat)
  8. Web 前端小白入门(一):心路历程,非技术指南
  9. Altium Designer19 生成Gerber文件方法
  10. 有没有什么好用的pdf编辑软件?3款App轻松编辑所有PDF文件
  11. python爬取微信运动_微信运动数据抓取(Python)
  12. DNS 攻击方式及攻击案例
  13. Markdown:VS Code中预览markdown的快捷键和markdown的简单语法
  14. 微信小程序编译的错误解决办法:Error: accessSync:fail no such file or directory
  15. 调用百度AI实现人像分割(下)
  16. (zt)魔方玩法(图解)
  17. 推荐一个单干网赚好站!BUXJOB - 健康程序员,至尚生活!
  18. 图片分享应用Pinterest上市首日大涨28% 市值超120亿美元
  19. 寓言之政府和计划生育——写在30年后的又一次改革——上海自贸区的成立
  20. /dev/random与/dev/urandom

热门文章

  1. 背英语单词很困难,不妨学习一下词根词缀吧(每天10个词根、词缀)Part 1
  2. [kubernetes] 资源管理 --- 资源预留实践
  3. 目标检测的图像特征提取—Haar特征
  4. 机器学习 测试_测试优先机器学习
  5. 第四大运营商正式申请5G牌照,三大运营商如何应对?
  6. stepinto stepout stepover的区别
  7. java命令_JAVA与模式之命令模式
  8. 免安装版的mysql步骤_mysql免安装版的安装方法及步骤
  9. 最大子序列求和_算法——求最大子段和
  10. ztree 自定义参数_Ztree节点前加上两个自定义按钮