OpenGL transparent window(OpenGL半透明窗口)

1)在OpenGL渲染的窗口中使用半透明效果和普通窗口没有什么区别

 SetWindowLong(  m_hWnd, GWL_EXSTYLE,WS_EX_LAYERED );           
 SetLayeredWindowAttributes( 0, 240, LWA_ALPHA);//alpha = 240,范围0~255;也可以使用关键色,详见MSDN

2)OpenGL半透明窗口指的是覆盖窗口(WS_OVERLAPPED或者WS_POPUP ,其实只要不是WS_CHILD就可以,因为WS_OVERLAPPED为0 ),

而不是Blend,不要一看到半透明就想到Blend,Blend是图元和帧缓存的混合,没有任何理由混为一谈。

3)WS_EX_TRANSPARENT

     Hit Testing

     Hit testing of a layered window is based on the shape and transparency of the window. This means that the areas of the window that are color-keyed or whose alpha value is zero will

     let  the  mouse messages through.

     If the layered window has the extended window style, the shape of the layered window will be ignored and the mouse events will be passed to the other windows underneath

     the layered window.

     使用WS_EX_TRANSPARENT 风格的窗口,对于关键色,或者ALPHA为0的像素将忽略鼠标命中测试; 如果同时也使用了WS_EX_LAYERED ,将会导致忽略所有鼠标事件。

     MSDN: Win32 and COM Development/Technical Articles/User Interface/User Interface Design and Usability/Layered Windows

 

 

 

转载于:https://www.cnblogs.com/cgwolver/archive/2008/11/17/1334736.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值