Handling hi res

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.
This topic is 3 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Handling hi res

Post by Lembasts »

Greetings,
I have a PS studio app which looks fine on most monitors. However someone just got a 4k monitor and everything looks awful.
How difficult is it to make sure every control is sized appropriately for hi res monitors?

Thanks
David
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Handling hi res

Post by jvierra »

It depends on the form and if the form was designed with a consistency and layout that lends it self to translation.
You need to look at the Sapien blogs that discuss how to work with this. Look in the InfoCenter for articles on working with hi-rez monitors.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Handling hi res

Post by Lembasts »

Thanks. It appears that I have to recalculate the size of every control in the load event?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

Re: Handling hi res

Post by Alexander Riedel »

Not necessarily. That really depends on your original layout and the scaling factor used on the 4K monitor. Screenshots from both would help greatly to provide an opinion.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Handling hi res

Post by Lembasts »

Thanks - but being department of defence we cant show anything. Im just trying to get my head around the basic concepts, sizing and scale, to understand exactly what it is that needs doing...
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Handling hi res

Post by Lembasts »

Mostly it seems to be the text not scaling. e.g. the text that used to display fine on a button no longer fits. Its like the button shrunk but the text didnt. There also are a few issues with drop down list boxes where they dont seem to fit where they used to.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Handling hi res

Post by Lembasts »

I can post a snippet. Here you can see that the buttons have sized ok relative to the group box but the button text and groupbox text is way to large.
Snap1.jpg
Snap1.jpg (22.01 KiB) Viewed 2879 times
As the text within the button is not a control in itself, does that mean that I have to adjust all other controls like the form and groupbox and buttons to be larger to fit the text?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

Re: Handling hi res

Post by Alexander Riedel »

Can you show that snippet in its "normal" form, for comparison?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Handling hi res

Post by Lembasts »

Sure.
Snap2.jpg
Snap2.jpg (40.34 KiB) Viewed 2875 times
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Re: Handling hi res

Post by Lembasts »

Looking at https://info.sapien.com/index.php/guis/ ... i-displays
it appears I just have to run set-dpiawareness at form load and then set autoscale to font.
Then do a bit of docking and some manual font setting and all will be well?
This topic is 3 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked