Transparent background for off-screen rendering

Having problems with building or using the JCEF Java binding? Ask your questions here.

Transparent background for off-screen rendering

Postby shannah » Tue Oct 27, 2020 12:06 pm

I'm having a hard time figuring out how to get transparent backgrounds in an off-screen renderer. I've been banging my head on this for a couple of days now and can't seem to get either the settings.background_color property to do anything (for any color - let alone transparent colors). And also setting the "transparent" argument of CefBrowser_N.createBrowser() to true. No effect. The alpha values in my onPaint callback are always 0xff.

Has anyone else successfully gotten transparent background working for OSR?

Ultimately I'm trying to obtain a screenshot of an HTML element on the page, but transparency is important.
shannah
Techie
 
Posts: 30
Joined: Wed Jul 08, 2020 8:01 am

Re: Transparent background for off-screen rendering

Postby Czarek » Tue Oct 27, 2020 12:42 pm

Maintainer of the CEF Python, PHP Desktop and CEF C API projects. Connect with me on LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1913
Joined: Sun Nov 06, 2011 2:12 am

Re: Transparent background for off-screen rendering

Postby shannah » Wed Oct 28, 2020 7:10 am

Thanks for the reply. After looking through the commits in Git, I noticed a relatively recent update in the version of CEF.
https://github.com/chromiumembedded/jav ... 2f5aa681b8

When I rebuilt with that version, it corrected the issue and I was able to get transparency working.

Best regards

Steve
shannah
Techie
 
Posts: 30
Joined: Wed Jul 08, 2020 8:01 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 2 guests