如何使用GDI函数绘制字幕

问题描述:


在Windows资源管理器中,如果按住鼠标左键并在窗口周围移动,则会出现一个蓝色的半透明选择框.当您在选取框周围移动鼠标时,选取框内或选中框内的所有项目都会被选中.我想知道是否有人对如何响应InvalidateRect的调用绘制这样的字幕感兴趣?我熟悉标准的GDI函数(PatBlt,BitBlt,LineTo等),但不知道如何使选取框不透明.在Windows资源管理器中,您可以清楚地看到实际选取框下面的项目.

在此先谢谢您.

Hi,
In windows explorer if you hold the left mouse button down and move it around the window a blue translucent selection marquee appears. As you move the mouse around the marquee grows and all items touched by or inside the marquee are selected. I was wondering if anyone had any idea on how to paint such a marquee in response to a call to InvalidateRect? I am familiar with standard GDI functions (PatBlt, BitBlt, LineTo etc. etc.) but have no idea how to make the marquee opaque. In Windows explorer you can clearly see the items underneath the actual marquee.

Thanks in advance.

GDI +可让您使用argb颜色进行绘制. "a"部分可让您透明地工作. a = 0->透明,a = 255->不透明.

请参阅 GDI + [
GDI+ lets you draw using argb colors. the ''a'' part lets you work with transparency. a=0 -> transaprent, a=255 -> opaque.

See GDI+[^] for more information.

Regards
Espen Harlinn