Why are icons in property sheets rendered with so few colors?

感情迁移 提交于 2019-12-01 05:54:48

问题


I am creating a property sheet shell extension and want to have a little icon to set off my property tab from the standard system tabs. Unfortunately, my icon is being rendered almost entirely in grey.

Original image:

In the property sheet tab:

At first I thought this was somehow my problem, but then I saw that TortoiseSVN appears to have the same problem:

This happens in both Windows 7 and Windows 8.

Does anyone know why these images are appearing so muted? Also, does anyone have any hints on how to make the icon look good in spite of this colorlessness?


回答1:


The PropertySheet function initialises its tab control with a 16 color (ILC_COLOR) ImageList and copies the supplied icon for each page into it. There doesn't seem to be a way to override this and supply your own ImageList (or to specify the bit depth of the created ImageList). Presumably this is a legacy of the original Windows 95 code that never got updated as things moved on.




回答2:


Instead of Property Sheets, you can use Tab Control, which makes tabs management more flexible and clear. And of course you can use any type of icons, because you have to create your own ImageList.

Here you can read about Tab Controls:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb760548(v=vs.85).aspx

And here you can access example usage of Tab Controls:

Icons in Win32 Property Pages are ugly - 4 bit icons



来源:https://stackoverflow.com/questions/15366517/why-are-icons-in-property-sheets-rendered-with-so-few-colors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!