How to draw Windows 7 taskbar like Shaded Buttons

2020-03-30 05:35发布

Windows 7 taskbar buttons are drawn on a shaded background. The color shade somehow reacts on where the mouse is over the button.

I'd like to use such buttons in my application. How can i do that ?

4条回答
爷的心禁止访问
2楼-- · 2020-03-30 06:15

It uses the new animation api (Some of it exists in Vista, extended in 7) There is no magic style to set, you still need to do the drawing on your own

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2020-03-30 06:29

I believe they're implemented as shader programs on the GPU. Just a simple program which takes the cursor position, and computes a brightness for each pixel based on the distance from that position.

查看更多
虎瘦雄心在
4楼-- · 2020-03-30 06:31

Perhaps try

DrawThemeBackground

http://msdn.microsoft.com/en-us/library/bb773289(VS.85).aspx

Give it the BS_PUSHBUTTON constant. I've used this in Windows XP to draw the plush blue XP themed controls, but not in Aero, but it's worth a try.

查看更多
Luminary・发光体
5楼-- · 2020-03-30 06:37

The effect is called "Color Hot-track". It does not seem that there is a dedicated API for that. There are some notes in a developer blog about it:

I found some source code from Rudi Grobler though doing a similar thing:

Make your WPF buttons color hot-track!

查看更多
登录 后发表回答