Jump to content
Memnarch

Windows 1909 screws with my PixelPerInch in Designer on HDPI

Recommended Posts

Hi,

At my company, I have 4K screens and a HDPI scale of 200%. The IDE works as normal, because it is not hdpi-aware. Windows is 10 1809

 

At home I have WQHD Screens and some slight scaling enabled. All IDEs from XE to 10.2 show a PPI of 115 instead of 96 in the Designer. Windows 10 1909

 

And i can't wrap my head around the issue. I told Windows to disable the system enhanced stuff. But for some reason the IDE is still fed with the true PPI instead of emulated, like normal non hdpi ones do.

 

Anybody has any idea on what i can do? This does screw with ui i write for IDE-Plugins 😐

 

 

Edited by Memnarch

Share this post


Link to post

WOW i just found out: The reason was me using "custom dpi scaling". I only wanted 115% and not one of the existing settings like 125%. Now it does work as expected....

  • Thanks 1

Share this post


Link to post
7 hours ago, Tommi Prami said:

I think it is Delphi IDE fault, not the Windows 1909, but still, annoying.

Nope, it's a windows issue The IDE is not supposed to "see" the 115 ppi -.-

Share this post


Link to post
15 hours ago, Memnarch said:

Nope, it's a windows issue The IDE is not supposed to "see" the 115 ppi -.-

Why so? 

 

if you use windows setting 115ppi then it is 115 ppi, don't get how this is not IDE fault not to handle HighDPI correctly.

-Tee-

Share this post


Link to post

He told Windows not to tell RAD Studio anything about the "true" DPI. Windows should "lie", pass 96 DPI and then handle the scaling on the operating system level, instead of the application level.

 

Windows did so when using DPI scaling with 125% or 150%, but not with a "custom" 115%.

  • Like 2

Share this post


Link to post
23 hours ago, Der schöne Günther said:

Windows did so when using DPI scaling with 125% or 150%, but not with a "custom" 115%.

Exactly.

23 hours ago, Tommi Prami said:

Why so?

An application has to identify itself as HDPI aware in its manifest. By default this is enabled for your Delphi-Application, but you can disable it. If not enabled, windows passes 96ppi to the application, and all width/height values of all controls are in 96ppi space. Windows then scales up the rendered picture to the actual ppi. This is the reason old applications look blurry. Today, Windows 10 implements a more enhanced gdi virtualization (called System enhanced) where the drawcall is scaled up, instead of the final render, which avoids blurry text/lines. But it's still noticeable on graphics of old applications, being stretched and blurry. You can switch to the old "System" method on an applications compatibility properties tab to see how applications were scaled up pre W10 180x(or was it 190x?)

Something you have to credit Microsoft for, is their humongouse backwards compatibility. That's why HDPI was made an opt in, because applications have to manually deal with it. Similar to the WinVer thing they did with Windows 8 and 8.1. If the application didn't say it was aware 8.1 exists in its manifest, the system lied and looked like 8 on the api and file layer.

The Delphi-IDE is not marked as HDPI-aware, and recent UI revamps of the IDE made it more incompatible with HDPI than ever.

PS: Trick of the day: If you have an old non HDPI application were you draw text or shapes to a temp bitmap, make it device compatible using  CreateCompatibleBitmap (TBitmap creates only device dependend ones). That way, when you set it to a resolution of x, the internal resolution of that bitmap is x*systemscale, the gdi system enhanced virtualization will affect it and it won't look blurry. Something the VCL does wrong for some temp buffers 😕

Edited by Memnarch

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

×