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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Chromium.ZoomPct is always 100

Post Reply
RaelB
Posts: 26
Joined: Sun Feb 12, 2017 11:22 am

Chromium.ZoomPct is always 100

Post by RaelB »

Hello,

In MiniBrowser demo, I created another popupmenu item:

Code: Select all

procedure TMiniBrowserFrm.ZoomLevel1Click(Sender: TObject);
begin
  ShowMessage(Chromium1.ZoomPct.ToString);
end;
Even after I increase the zoom level a few times, the ShowMessage always shows just 100?
User avatar
salvadordf
Posts: 4573
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Chromium.ZoomPct is always 100

Post by salvadordf »

Hi,

CEF only allows to read the zoom value in a CEF thread.

You need to call TChromium.ReadZoom and the zoom value will be available in the TChromium.OnZoomPctAvailable event.
RaelB
Posts: 26
Joined: Sun Feb 12, 2017 11:22 am

Re: Chromium.ZoomPct is always 100

Post by RaelB »

Thanks.

If it's not in the CEF thread, would it not be better to return -1? Returning 100 is misleading. Perhaps this is at the CEF level...
Post Reply