cycfi / elements

Elements C++ GUI library
http://cycfi.github.io/elements/
3.13k stars 237 forks source link

[Feature Request]window transparent #427

Open wltyzh opened 1 week ago

wltyzh commented 1 week ago

I want to make the window partially transparent, that is, make the window transparent in the area where there is no drawing, but I have failed after many attempts, including using SetLayeredWindowAttributes and UpdateLayeredWindow.

SetLayeredWindowAttributes can only make the specified color transparent, such as black, but this will affect my other normally drawn black parts;

UpdateLayeredWindow should be more suitable, but I did not get any effect when I used it in the on_paint of the view;

Maybe UpdateLayeredWindow has some usage restrictions, such as it cannot be applied to child windows, and the WM_PAINT event cannot be responded to; I don’t know if I should use UpdateLayeredWindow in the parent window, but if it is used in the parent window, the content drawn by the view needs to be passed to the parent window, which may cause a lot of code modifications;

Is there any good way to achieve this effect?

djowel commented 1 week ago

Interesting. Such a feature would be cool, indeed. Alas, I have not investigated a way to do this, cross-platform. Some research is needed.