[DONE !!!] PB Formdesigner & DPI awareness confusion

You need some new stunning features ? Tell us here.
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

[DONE !!!] PB Formdesigner & DPI awareness confusion

Post by Kurzer »

Hello everyone,

I'm currently testing the PB internal form designer (5.70), because I thought I couldn't use Gnozal's "PureForm" anymore. The reason for this was that in old GUI projects the dimensions of the gadgets don't fit anymore when I load them into PureForm (e.g. texts are now wider than the width of the text gadget).

The whole problem is probably because these GUIs were created on my old computer where the desktop DPI setting was 100%. On my current computer with HD display it is 125%.

Since PureForm is not DPI aware, I assume that I shouldn't design GUIs on a "125% machine" anymore, because I would have to create the dialogs in 100% mode (which is too small for me on my current machine). If I would create them in such a way that I feel they fit on the 125% machine, they will be enlarged by 25% after compilation with DPI awareness at runtime - and that's too big at the end.

Here are a few examples to illustrate this with PureForm:
(I posted this topic also in the german forum, so the screenshots are commented in german, sorry for that)

Here a part of a GUI compiled without DPIA and executed on a computer with 100% desktop DPI (everything fits):
Image

Here now without DPIA and executed on a computer with 125% DPI:
Image

As expected, it doesn't fit anymore, so far so good.
(That the GUIs have the same width may be caused by the fact that the 100% DPI machine runs in a VM, which is hosted on my machine with 125% DPI)

Here are some examples compiled with DPI awareness.

With DPIA and executed on a computer with 100% DPI:
Image

Again everything is okay as expected.

Now one with DPIA and executed on a computer with 125% DPI:
Image

It also fits almost everything, because PB upscaled everything (a "ver-" has unfortunately disappeared).

When I load this GUI project in PureForm to edit it, it looks like this (on the 125% machine):Image

The GUI is not scaled and the text is not reduced. The gadgets are too small for the content. So I assume that I can only design a GUI in PureForm on a native 100% DPI machine, so that after compilation with activated DPI awareness everything is displayed in the right proportion. That's why I took a look at the PB internal designer (before I always avoided it because I don't like its handling).

Now a comparison with the PB internal designer. Both tests have been compiled on the 125% DPI machine.

A window compiled without DPI awareness:
Image

And here compiled with DPI awareness:
Image

Now we come to the point of confusion:

Do I always design the GUI in 100% mode here? Or rather in 125% mode, because my computer running PB is set to 125% DPI.

If I compile such a GUI with DPI awareness, does the executable have an even higher DPI resolution ( another +25% of 125% of the original size)?

What is actually 100% on my computer with 125% DPI setting? Can I even guess what the GUI looks like on a real 100% DPI computer?

Here again everything in comparison, but as I said the 100% computer runs in a VM, which runs on the 125% computer.

Image

Shouldn't the PB Designer have a setting to work in the 125% size while designing? One could then already determine during the design if the GUI is too large or not.

But as I said, if the designer scales it again by 25%, on a 125% computer is it really 125% or already 156.25% (125 + 25% of 125).

The longer I think about it, the more it confuses me. :shock: :(
Can anyone give me a definitive statement on this?

Thank you very much.

Kind Regards
Kurzer
Last edited by Kurzer on Sun Feb 02, 2020 5:21 pm, edited 1 time in total.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: PB Formdesigner & DPI awareness confusion

Post by Kurzer »

Sorry for pushing this, but that nobody reacts to this topic confuses me a bit. Maybe my fears are nonsense and I just overlook something you take for granted or the problem with the 125% + 25% DPI scaling is a real problem that needs to be thought about first. And maybe that's the reason why nobody has written anything about it yet.

Can any of you perhaps post a screenshot of the standard window from the form designer here, which was shot on a computer with real 100% desktop scaling? I would like to know if this has a different size than the screenshot of my "100%" window, which was displayed in a VM running on a 125% computer.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: PB Formdesigner & DPI awareness confusion

Post by Dude »

kurzer wrote:Can any of you perhaps post a screenshot of the standard window from the form designer here, which was shot on a computer with real 100% desktop scaling?
Hi Kurzer, I just saw your post. Is this what you're after? Win 10, 100% DPI of Form Designer when I launch PureBasic 5.70 LTS:

Image
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: PB Formdesigner & DPI awareness confusion

Post by Kurzer »

Yes correct, that's the form designer I meant (the PB internal).

If you use it with 100% desktop scaling everything is okay. But create a GUI on a computer with 125% desktop scaling and compile the exe with DPI awareness enabled in the compiler settings. Then the GUI will be bigger than it was at design time. That would be wrong, because the GUI was already created with the form designer in 125%.

Here is an simple example made with PB 5.70 on a computer with 125% desktop scaling.

Image

On the left side you see the window in editing mode in the form designer.
On the right side its the resulting EXE compiled with DPI awareness activ.

So how we can design GUIs on a computer with a different desktop scaling of 100%?
I have to create all gadgets 25% too small in the form designer, to get a proper GUI at runtime. Was that the plan of DPI awarenes in PB 5.70? :(
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

[DONE!!!!] Re: PB Formdesigner & DPI awareness confusion

Post by Kurzer »

kurzer wrote:If you use it with 100% desktop scaling everything is okay. But create a GUI on a computer with 125% desktop scaling and compile the exe with DPI awareness enabled in the compiler settings. Then the GUI will be bigger than it was at design time. That would be wrong, because the GUI was already created with the form designer in 125%.
I am happy to report that this problem is gone wirh PB 572 b1 x64! Image
Good Job, Fred. Thank you!

Even if I design a GUI using a 125% scaled windows desktop, the compiled result is correctly scaled in DPIA and no DPIA mode. Without DPIA activated the compiled GUI is 25% smaller than the GUI in the formdesigner ... and that's correct.

Image

Greetings
Kurzer
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
Post Reply