New and old psf files, and DPI scaling

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
JeffreyN
Posts: 4
Joined: Thu Apr 20, 2017 4:38 am

New and old psf files, and DPI scaling

Post by JeffreyN » Wed Apr 10, 2019 7:54 pm

I have a project created quite a while ago, in Powershell Studio 2017 if not 2016. Basically before high DPI scaling came in. Now running 2019, and all of the current updates.

Recently I have added a 4K monitor to my computer, so getting all of the challenges of scaling, which is to be expected. I have tried to follow the design principles for high DPI and scaling in the original project, but still not getting it right in some areas.

The design principles are noted in https://info.sapien.com/index.php/guis/ ... i-displays and mentions new functions / snippets were added around then.

This brings me on to the question.. Is there a difference in scaling for recently created psf files and older psf files? The project contains several psf files, created at different time periods. The newer ones scale perfectly without changes, the older ones are all over the place, despite both using the same kinds of design principles. For example two forms, each containing a text box, a button and a label. In the older file, I end up with overlapping elements and tiny fonts, where a similar form which was recently added will scale well.

User avatar
davidc
Posts: 5836
Joined: Thu Aug 18, 2011 4:56 am

Re: New and old psf files, and DPI scaling

Post by davidc » Thu Apr 11, 2019 7:13 am

Yes, you need PowerShell Studio v4.2.124 or higher to support DPI scaling. So, if the psf was not updated in a newer version, it will most likely not scale correctly.

To update the psf files you should just have to open them and hit Save. I recommend doing this in a 96 DPI environment, so that the correct scale is applied. The reason is you want to do this is to match the same DPI when the form was created.
David
SAPIEN Technologies, Inc.

User avatar
JeffreyN
Posts: 4
Joined: Thu Apr 20, 2017 4:38 am

Re: New and old psf files, and DPI scaling

Post by JeffreyN » Thu Apr 11, 2019 8:09 pm

Thanks David. I have updated the files from a 96dpi environment on newer powershell studio, but it's still doing odd scaling. That's OK, I am taking this as an excuse for a redevelopment of the project (Starting with good practices).

User avatar
davidc
Posts: 5836
Joined: Thu Aug 18, 2011 4:56 am

Re: New and old psf files, and DPI scaling

Post by davidc » Fri Apr 12, 2019 7:12 am

When it comes to DPI scaling: Anchoring, docking and table layouts make the difference.
David
SAPIEN Technologies, Inc.

Locked