transparent background of native window

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

transparent background of native window

Postby BeeeDeee » Wed Aug 03, 2016 6:58 am

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
BeeeDeee
Newbie
 
Posts: 4
Joined: Fri Jul 08, 2016 3:00 am

Re: transparent background of native window

Postby amitrs » Sun Aug 28, 2016 2:22 am

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 :)
amitrs
Newbie
 
Posts: 1
Joined: Sun Aug 28, 2016 2:09 am

Re: transparent background of native window

Postby BeeeDeee » Fri Sep 02, 2016 12:37 am

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.
BeeeDeee
Newbie
 
Posts: 4
Joined: Fri Jul 08, 2016 3:00 am

Re: transparent background of native window

Postby gpbeta » Fri Sep 02, 2016 3:49 am

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
Joshua GPBeta
gpbeta
Newbie
 
Posts: 7
Joined: Thu Jun 23, 2016 2:47 am
Location: China

Re: transparent background of native window

Postby sikor » Tue Sep 27, 2016 6:22 am

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?
sikor
Techie
 
Posts: 12
Joined: Tue Sep 27, 2016 4:08 am

Re: transparent background of native window

Postby yosoymin » Tue Sep 08, 2020 7:18 am

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
yosoymin
Techie
 
Posts: 11
Joined: Mon Mar 02, 2020 1:28 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 32 guests