4
votes

Have tried to obtain a screenshot from the ChromiumEmbedded browser for Delphi XE2/Firemonkey, but the ChromiumFMX.MakeScreenshot method only returns an empty bitmap.

Anyone have any idea how to obtain a bitmap?

Thx.

1
What version of Chromium do you have ? I can't find the MakeScreenshot method in the most recent one.TLama
MakeScreenshot is part of FMX's TControl component, an ancestor of TChromiumFMX. What the version is concerned, found this in ceflib.pas. Is this useful? CEF_REVISION = 607; COPYRIGHT_YEAR = 2012; CHROME_VERSION_MAJOR = 18; CHROME_VERSION_MINOR = 0; CHROME_VERSION_BUILD = 1025; CHROME_VERSION_PATCH = 166;Domus
Then it's not in the current trunk. There's even nothing with keyword Screenshot in the whole project.TLama
I had hoped this was taken care of by TControl, but apparently doesn't function with TChromiumFMX.Domus
Too bad TControl.MakeScreenshot isn't virtual; otherwise you could override it using Domus’s answer.Martijn

1 Answers

4
votes

Instead, use the following (be sure to instantiate YourBitmap prior to this call):

CefGetBitmap(ChromiumFMX.Browser, PET_VIEW, YourBitmap);