Jump to content
bdw_nz20

Manual HDPI setting for VCL window

Recommended Posts

Posted (edited)

I've just been playing a little bit with one of our applications to allow HDPI, not done much on this till now.

 

Its working when changing the scaling for all windows i.e. change it in the display settings to 125%, 150% etc.

 

I was just wondering if it was possible, like other applications can, to just adjust the VCL application rather than all windows.

 

For example some windows allow Ctrl+ and Ctrl- keys to scale up and down of the window.

 

Edited by bdw_nz20

Share this post


Link to post
13 hours ago, bdw_nz20 said:

I've just been playing a little bit with one of our applications to allow HDPI, not done much on this till now.

 

Its working when changing the scaling for all windows i.e. change it in the display settings to 125%, 150% etc.

 

I was just wondering if it was possible, like other applications can, to just adjust the VCL application rather than all windows.

 

For example some windows allow Ctrl+ and Ctrl- keys to scale up and down of the window.

 

You can experiment with the ScaleBy method all TWinControl descendants inherit, including forms.

Share this post


Link to post

Problem with doing this is that it will scale your window size also which is usually not what you want.

Share this post


Link to post

I try to use EM units say roughly a font of 72 would be one inch high, on a laser printer of 600 dpi you get one inch high lettering.    Using CSS you can set the sizing to show the ... when the ... rule is set. 

 

Somehow windows can make small images when hovering over an icon or medium size images in task view.   What's neat the image is animated. 

 

Now I just right-size the form and use units of "fat-finger" on custom control resize events.    This resize event helps on the 4k machines.

 

 

 

 

  

Screenshot 2024-03-18 222616.png

Share this post


Link to post

Thanks all for the suggestions.

 

I was hoping there was a simple Windows message the could be sent to trigger the DPI change to the application.

Share this post


Link to post
Posted (edited)
23 hours ago, bdw_nz20 said:

I was hoping there was a simple Windows message the could be sent to trigger the DPI change to the application.

Sorry, that is not how HDPI works.

Edited by Remy Lebeau

Share this post


Link to post
On 3/24/2024 at 9:19 AM, Remy Lebeau said:

Sorry, that is not how HDPI works.

Hey Remy, yes I do understand it was just a hope to make life easier for my testing of an application that can have many dynamically created displays to check it performs.

My dev system has a 32 inch monitor which I use one side for IDE and other side for app testing rather than multiple monitors as I've had in the past.

It just becomes a pain with all the various windows re-sizing and becoming useless (or difficult to use) while testing minor code changes.

I was just looking for any easy way for my present setup to test more easily.

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

×