Hi
I know about the VCL and screenshots but not FMX and in normal mode.
Is there a build-in feature to make a screenshot in FMX and normal mode?
Thanks,
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Screenshot with FMX and normal mode
- salvadordf
- Posts: 4572
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Screenshot with FMX and normal mode
Hi,
You should be able to get a screenshot with an FMX application if you call TChromium.TakeSnapshot
Make sure you set GlobalCEFApp.EnableGPU to FALSE before the GlobalCEFApp.StartMainProcess call in the DPR file because TChromium.TakeSnapshot only works when hardware acceleration is disabled.
You should be able to get a screenshot with an FMX application if you call TChromium.TakeSnapshot
Make sure you set GlobalCEFApp.EnableGPU to FALSE before the GlobalCEFApp.StartMainProcess call in the DPR file because TChromium.TakeSnapshot only works when hardware acceleration is disabled.
Re: Screenshot with FMX and normal mode
Thanks,
Im using the TFMXChromium (using SimpleFMXBrowser example) now. Should I replace it with the TChromium ? TFMXChromium does not have that procedure.
Im using the TFMXChromium (using SimpleFMXBrowser example) now. Should I replace it with the TChromium ? TFMXChromium does not have that procedure.
Re: Screenshot with FMX and normal mode
I think that does not work:
function TChromium.TakeSnapshot(var aBitmap : TBitmap) : boolean;
the bitmap here is a VCL bitmap. Not compatible
function TChromium.TakeSnapshot(var aBitmap : TBitmap) : boolean;
the bitmap here is a VCL bitmap. Not compatible

- salvadordf
- Posts: 4572
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Screenshot with FMX and normal mode
You're right. Sorry for the confusion.
I'll try to create a TakeSnapshot function for TFMXChromium
I'll try to create a TakeSnapshot function for TFMXChromium
Re: Screenshot with FMX and normal mode
I already found one, its looks a lot like your code. It still uses vcl bitmap but uses streaming between that vcl and the FMX bitmap.
https://github.com/z505/screenshot-delphi
https://github.com/z505/screenshot-delphi
- salvadordf
- Posts: 4572
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Screenshot with FMX and normal mode
Please, download CEF4Delphi again from GitHub.
I just uploaded a new version with 2 new functions :
I just uploaded a new version with 2 new functions :
- TFMXChromium.TakeSnapshot
- TFMXChromium.SaveAsBitmapStream