Page 1 of 1

transparent background of native window

PostPosted: Wed Aug 03, 2016 6:58 am
by BeeeDeee
Hi,

I'm trying to make background of native window transparent (branch 2623, win7x64, VS2013) and then use CSS: "background: transparent;". It should look like this:
Image

I found many topics about this issue e.g. link1, link2, link3, but nothing works for me = background is still black, white or there is some transition...

When I run cefclient with parameters "--transparent-painting-enabled --off-screen-rendering-enabled" I got this result (I absolutely have no idea, where that background transition came from):
Image

How can I achieve this goal? Should I edit Chromium or CEF?

I also considered create Win32 app (1st img) and include CEF there (rendering web page), but I don't know how to do that...

Thank you very much for your reply

Re: transparent background of native window

PostPosted: Sun Aug 28, 2016 2:22 am
by amitrs
When I run cefclient with parameters "--transparent-painting-enabled --off-screen-rendering-enabled" I got this result (I absolutely have no idea, where that background transition came from):


--transparent-painting-enabled is a cefclient option where it set the cef to pain the background including transparency data (probablary sets window_info.transparent_painting_enabled = true).
This is what you and me want

--off-screen-rendering-enabled make cef render to off-screen with/without transparency, it is not hw accelerated.

Now the colored bg in the image is the color of the window behind the cef, so we only need to make the parent and above in hierarchy transparent. but that is win32 specific problem.

I am also looking for same solution, and after a lot of playing with vs 2015, qt i could not get a solution. I still post for help in this forum.

If you got anything please let me on to it :)

Re: transparent background of native window

PostPosted: Fri Sep 02, 2016 12:37 am
by BeeeDeee
Any progress? :D

I think it would be possible with LWA_COLORKEY. http://forum.unity3d.com/threads/solved-windows-transparent-window-with-opaque-contents-lwa_colorkey.323057/
I made a simple Win32 app, where this principle works, but I don't know how to use it with CEF.

Re: transparent background of native window

PostPosted: Fri Sep 02, 2016 3:49 am
by gpbeta
I think you should use Layered Window with CEF transparent rendering feature to achieve your goal.

Here's a desktop snap of my project using these specs:
Image

Re: transparent background of native window

PostPosted: Tue Sep 27, 2016 6:22 am
by sikor
Hi,

I think you should use Layered Window with CEF transparent rendering feature to achieve your goal.


Could you please give more details about this solution?

Re: transparent background of native window

PostPosted: Tue Sep 08, 2020 7:18 am
by yosoymin
I've found a way this is possible using views framework and a simple modification in CEF code. This is working in Windows and Linux. More info in this thread: https://www.magpcss.org/ceforum/viewtop ... =8&t=17421