CMFCToolbar:如何使用高度不等于15的位图? [英] CMFCToolbar : How to use Bitmaps with height unequal to 15?

查看:87
本文介绍了CMFCToolbar:如何使用高度不等于15的位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS2015项目中创建了不同的工具栏(MFC项目,MDI,Visual Studio样式项目)。

I am creating different toolbars in my VS2015 project (MFC Project, MDI, Visual Studio Style Project).

通过调用DockPane(..)将工具栏停靠到CMFCMenuBar。

The toolbars are docked to CMFCMenuBar by calling DockPane(..).

互联网上有很多免费图标可供我使用。

There are a lot of free icons available in internet, which I would want to use.

不幸的是,只有16x16大小的图标可用。工具栏的标准尺寸为16x15!

Unfortunately there are icons available only with 16x16 size. The standard size for a toolbar is 16x15 !

我尝试使用16x16(24位颜色)创建高分辨率工具栏,并且实际上它可以正常工作。

I tried already creating the High Res Toolbars with 16x16 (24Bit colors), and acually it works.

但是有一个副作用:

每次重新启动应用程序时,停靠的工具栏都会改变它们的位置。他们正在向右侧移动一些像素。实际上他们应该保留他们在程序退出之前的位置。

Each time, when I restart the application, the docked toolbars are changing their positions. They are moving to the right side for some pixels. Actually they should keep their position, which they had before program exit.

原则上:是否可以使用高度为>的工具栏位图? 15像素?我应用程序出现奇怪行为的原因是什么?

In principle: Is it possible to use toolbar bitmaps with height > 15 pixel? What could be the reason of the strange behaviour of my application?

非常感谢,

Richard

推荐答案

您可以使用CMFCToolbar :: SetSizes()将高度和宽度设置为16x16或其他任何内容。



https ://msdn.microsoft.com/en-us/library/bb984480.aspx#cmfctoolbar__setsizes

-Seetharam

-Seetharam


这篇关于CMFCToolbar:如何使用高度不等于15的位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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