Page 1 of 1

Chromium.ZoomPct is always 100

Posted: Tue Apr 28, 2020 4:24 pm
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?

Re: Chromium.ZoomPct is always 100

Posted: Tue Apr 28, 2020 5:24 pm
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.

Re: Chromium.ZoomPct is always 100

Posted: Wed Apr 29, 2020 10:15 am
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...