黑色高亮条与GDI [英] Black highlight bar with GDI
问题描述
我有一些不错的拆分器代码为我的GUI,但我不能得到钢笔/刷/无论是我需要做适当的高亮。你知道如何在visual studio 10,分割条可以拖动,有一个美丽的黑色透明条,让你知道分裂会发生什么时,你抬起鼠标按钮。如下图所示: http://www.freeimgshost.com/fullsize/efmcxyyu1wbyb1r7mz0.png
I got some nice splitter code for my GUI but I can't get the pen/brush/whatever it is I need to do proper highlighting. You know how in visual studio 10, the splitter bars can be dragged and there's a beautiful black transparent bar letting you know where the split will happen when you lift up your mouse button. Here's a picture: http://www.freeimgshost.com/fullsize/efmcxyyu1wbyb1r7mz0.png
如何使用GDI和c ++实现黑色高亮条?
How can I achieve that black highlight bar using solely GDI and c++?
推荐答案
Visual Studio UI是在WPF中实现的,因此我猜测分割条只是一个半透明的填充矩形。
The Visual Studio UI is implemented in WPF, so I'd guess that the splitter bar is just a semi-transparent filled rectangle.
对透明度的支持相当差。
However, GDI has fairly poor support for transparency.
您可以使用半透明的,始终在顶部的分层窗口获得相同的效果。这是一个简单的解决方案,因为你不必担心重绘任何东西。您只需移动窗口即可。
You could get the same effect using a semi-transparent, always-on-top, layered window. This is a simple solution because you don't have to worry about repainting anything. You just move the window about.
此答案针对另一个问题有一些代码创建这样的窗口(用于不同的目的)。
This answer to another question has some code that creates such a window (for a different purpose).
这篇关于黑色高亮条与GDI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!