Search code examples
delphiresolution

Delphi program resolution


We have a Delphi 7 program running on Windows 7 Professional SP1, developed approximately 10 years ago. On the current system, it became unusable as some form elements have incorrect size so the text they contain doesn't fit there or the graph overflows the bottom of the window:

Picture 1: Table rows have incorrect size (or the text is bigger than it should be)

enter image description here

Picture 2: There is a graph in the window but the bottom part of the graph isn't visible. And there are no scrollbars...

enter image description here

We have no source code nor we do we have contact with the people who developed the software. We think the software was built in Delphi 7 because it uses several xxxx70.bpl libraries.

We tried to change resolution of the screen and change compatibility mode used to run the program with no luck.

Is there anything we can try?


Solution

  • Your program is not DPI aware, and you are running with font scaling settings that mean the application is asked to scale. The application font is scaled automatically but your Delphi application does not adapt.

    I can see some options for you:

    • Run your machine with 100% font scaling.
    • Run your machine with >125% font scaling. Then DPI virtualization will kick in which should fix the issue. Although the app may appear fuzzy as it will suffer aliasing when scaled.
    • Try to find a compat setting that forces DPI virtualization. Don't know if such a thing exists.
    • Edit the .dfm resources in the executable to set the Scaled property to true. This would require a resource editor that understands Delphi. For instance XN resource editor. I've no idea whether or not this will work. If it does work, each form will re-scale themselves according to the font scaling.

    Update

    Forcing DPI virtualization won't help, on second thoughts. The system will tell your app that the font scaling is 125% and scale from there. But your app won't even handle 125% scaling correctly it seems. So you have little option other than to disable all font scaling or perhaps try with the Scaled property.