salvadordf / CEF4Delphi

CEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows, Linux and MacOS.
https://www.briskbard.com/forum/
Other
1.19k stars 363 forks source link

about scale #489

Closed Evanchl closed 8 months ago

Evanchl commented 8 months ago

Hi, here's my problem i code on delphi 10.1, with 2k screen (150% on windows scale) and without Enable-High-DPI When i launch my app without cef no problem, and when i add :

CreateGlobalCEFApp; if GlobalCEFApp.StartMainProcess then

the app length and height are only 2/3 of the original size

How do I solve this problem? please give me some code to fix it ![Uploading image.png…]()

salvadordf commented 8 months ago

Hi,

I can't see the attached screenshot but this seems to be a duplicate if the issue #484

Evanchl commented 8 months ago

issue #484 i can not find the answer. i run DLLBrowser demo before i click 1. Initialize it's normal image

after i click 1. Initialize ,It has become smaller and form caption disappeared。 image

image

salvadordf commented 8 months ago

I tested the DLLBrowser demo again with Delphi 12 in Windows 10 with a 4k monitor using 200% scale and it works correctly.

Please, check that the CEF4DelphiLoader project has the right manifest settings.

Right-click on the "CEF4DelphiLoader.exe" node in the "Projects" panel and select "Options".

Then go to the "Application -> Manifest" section and make sure the "DPI awareness" option has a "Per monitor" value and the "Manifest File" option is set to "Auto Generate".

salvadordf commented 8 months ago

Another workaround: call SetProcessDpiAwareness before loading the CEF.

Similar issue in stackoverflow.