Jump to content
msd

Delphi 11.1 - High DPI

Recommended Posts

Hello,

 

I have one big project and I migrated it from older versions of Delphi to the latest Delphi 11.1.

High-DPI is one of the unsolved issues.

When I start the app on a computer which has activated zoom over 100% (High-DPI screen), the whole components are in a mess on all forms.

So, how to solve this scenario so that my app can keep resolution and aspect ratio every time in every zoom factor on the client's PC?

 

Thanks for the help and support in advance.

Share this post


Link to post

The quick and lazy way to handle this is to turn off the Scaled property in all your forms but then all your controls will be really tiny when the Windows scaling is cranked up.

 

What you'll need to do is change several aspects of your forms to gracefully rearrange themselves as heights and widths change. Notice I didn't say "re-design" your forms but it does take some work. Get to know the Align and Anchors properties first. Consider using container components that automatically rearrange components but keep them in their place like the TFlowPanel and TGridPanel.

 

There are many other things you can do--a quick internet search will reveal many blog posts and articles over the years.  Here's a good starting point: https://zarko-gajic.iz.hr/writing-and-enabling-delphi-application-to-support-high-dpi-displays-and-4k-screen-resolutions/

  • Like 1
  • Thanks 1

Share this post


Link to post

Hello Uwe,

 

Delphi is not a problem; it works fine.

The problem is compiled applications and distributed on computers with high-DPI screens.

I need to solve deployed applications...

 

Thanks anyway for the advice.

Share this post


Link to post
7 minutes ago, msd said:

Delphi is not a problem; it works fine.

Please send me a copy of D11.1 that works fine. I did my best to support highDPI unfortunately I see no way to do that with D11.1 maybe in D14 will work.

  • Like 1
  • Sad 1

Share this post


Link to post
1 minute ago, Lajos Juhász said:

I see no way to do that with D11.1

I have several applications running fine on High DPI (even built with D10.4), but that may just depend on the specific applications.

 

Just to give a rough estimate: It took me about six weeks to get MMX Code Explorer working with D10.4 and there are still glitches like cut-off texts or overlapping controls. Most of them are not Delphi related, but lie in the nature of scaling integer values.

Share this post


Link to post

Without more context, it's impossible to say what is wrong in your case.

 

I was very pleasantly surprised when I updated on of our XE7 applications to 10.4 in order to support High DPI. It took me a few days, but everything seemed logical (I had to make a few small changes where the UI used a hard coded number of pixels) - And in the end, it turned out to be great.

Share this post


Link to post

I too adopt a very old app to be DPI-aware and even on D7 scaling works pretty well. I just had to ensure AutoScroll is False, Scaled is True and Client H and W <> 0 and set the main font to system one. Several remaining glitches could be fixed by giving more space. However I don't use much of 3rd party controls. F.ex., I recall VirtualTreeView has had scaling issues for long long time.

Share this post


Link to post
On 6/9/2022 at 4:29 PM, corneliusdavid said:

What you'll need to do is change several aspects of your forms to gracefully rearrange themselves as heights and widths change. Notice I didn't say "re-design" your forms but it does take some work. Get to know the Align and Anchors properties first. Consider using container components that automatically rearrange components but keep them in their place like the TFlowPanel and TGridPanel.

 

wth?

Share this post


Link to post

Der schöne Günther mentioned context.  A couple of questions come to mind that might help in homing in on the issue:

On 6/9/2022 at 3:05 PM, msd said:

I have one big project and I migrated it from older versions of Delphi to the latest Delphi 11.1

Did you run the Delphi 11 IDE in HiDPI mode while migrating the VCL project?  (Is your own development environment HiDPI?)

 

On 6/9/2022 at 3:05 PM, msd said:

When I start the app on a computer which has activated zoom over 100% (High-DPI screen)

Which version of Windows is that computer running (e.g. 7, 8, 10, 11) ?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×