OpenGL transparent window (OpenGL translucent window)

Source: Internet
Author: User

1) there is no difference between using translucent effects in OpenGL rendered windows and normal windows.

Setwindowlong (m_hwnd, gwl_exstyle, ws_ex_layered );
Setlayeredwindowattributes (0,240, lwa_alpha); // alpha = 240, range: 0 ~ 255; key colors can also be used. For details, see msdn

2) OpenGL translucent window refers to the overwrite window (ws_overlapped or ws_popup, as long as it is not ws_child, because ws_overlapped is 0 ),

Instead of blend, do not think of blend as soon as you see a translucent image. Blend is a mixture of the image and the frame cache, and there is no reason to confuse it.

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.

If ws_ex_transparent-style windows are used, mouse hit tests are ignored for key colors or pixels with Alpha 0. If ws_ex_layered is also used, all mouse events are ignored.

Msdn: Win32 and COM development/technical articles/User Interface/user interface design and usability/Layered windows

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.