Terry Thompson
Terry Thompson

Reputation: 533

Delphi 11 Form Designer Scaling

I just downloaded and installed a Trial of Rad Studio 11 on a Lenovo Yoga 720 with 16GB of RAM running Win 10 Pro. The laptop supports 4K resolution.

Forms designed in the IDE do not display the same when the application is run with a per Monitor v2 setting. Here is what I did after the initial installation.

I created a new VCL application and dropped a DBNavigator on it. Both the form and the DBNavigator were tiny. When I ran the application, the form and the navigator displayed correctly and at normal size, including bitmaps on the navigator.

I next went into Tool\Options\User Interface\Form Designer\High DPI and changed VCL Designer High DPI Mode mode from Low DPI (96 PPI) to Automatic (Screen PPI). In the designer, the form still displayed small, and when I ran the application, the form displayed normal size with bitmaps properly scaled.

Next, I F12 twice. The form remained the same dimensions (small) and the Navigator scaled to normal size. When I ran the application, I got the same result as before (normal size form, navigator, and bitmaps).

Last, I saved and reopened the project. The form was still small, the Navigator was the correct size, and the bitmaps on the Navigator were small. Running the application produced a small form, a normal size Navigator, and small bitmaps.

Even when I create a new VCL application with Automatic (Screen DPI) already set, the designed and runtime forms are different. In design mode, the form, navigator, and bitmaps are normal sizes. At runtime, the form and navigator are normal size, but the bitmaps are small.

Is there something different I need to do for this to all work the way one would expect (i.e., the application displays exactly as designed with Automatic (Screen DPI) turned on)?

Upvotes: 3

Views: 1923

Answers (1)

kishmet
kishmet

Reputation: 83

Did you already try the DPI unaware mode/version of RADStudio? This should result in a uniform scaling of all elements. Downside to this is, that you will need to scale your application yourself. For example with

function Calc4k(input: Integer):Integer;
begin
  result := MulDiv(Input, Screen.PixelsPerInch, 96);
end;

Another possible solution might be:

You should try to revert back to the LowDPI setting. The Automatic DPI (at least for me) is causing more problems with the sizing of my forms. I am running with the low DPI setting on my 4K monitors and it works just fine with the normal Version of Delphi 11.3 and also this holds true for Delphi 12.

Also, just in case this holds true: If the bitmaps are custom ones, you would need to scale them yourself, for example with something like the function from the code snippet above: Calc4k(input)

Upvotes: 0

Related Questions