FireMonkey & Transparency

441 views
Skip to first unread message

Jeff

unread,
Mar 18, 2012, 2:10:32 PM3/18/12
to delphichromiumembedded
I just discovered CEF and this project and I really appreciate the
work that was done to port CEF to Delphi.
I am planning to use it, but I was wondering if it is possible using
FMX and CEF (in Delphi XE2) to have transparent web pages (support for
alpha). I was trying to use the FireMonkey demo and setting
transparency of the form to true, but since this is also my first time
with FireMonkey I am a little bit lost, and I don't know if this is
possible.

My goal would be to build a kind of HTML "widget" form that can float
over the desktop with all the GUI being defined in HTML (with maybe
some native FMX forms) and allow for (per pixel) alpha blending with
the background Windows desktop,

If someone think it is possible to do that let me know (or maybe this
is something to consider for future development).

Thanks,
Jeff

Jeff

unread,
Mar 18, 2012, 5:51:38 PM3/18/12
to delphichromiumembedded
I actually found a way to do it, not sure this is the best method.

I changed the following line in procedure TCustomChromiumFMX.doOnPaint
in unit ceffmx:
from:
PAlphaColorArray(dst)[j] := PAlphaColorArray(src)[j] or
$FF000000;
to:
PAlphaColorArray(dst)[j] := PAlphaColorArray(src)[j];

I also had to add the following line in procedure
TCustomChromiumFMX.CreateBrowser:
info.m_bTransparentPainting := True;

Now, it works great, I get full alpha transparency!

Note: I am using SVN r134 (Dec 17) since I could not get the latest
version to work (demo apps were crashing).

Jeff
Reply all
Reply to author
Forward
0 new messages