Scaling issue - DPI aware activates itself and break layouts
Scaling issue - DPI aware activates itself and break layouts
Hello, everyone,
it may not be that easy to and it took me a long time to crystallize it exactly.
So I've decided to post it here again because it's a very bad mistake.
Unfortunately I can't tell if it is a bug of the OS or PB.
But it is already more than helpful to know that he exists and what he does,
because it is almost impossible to find and locate him.
In Windows there are the extended scaling,
that is, where you can enlarge the desktop.
These are not those that are fixed, but those that have to be typed in by hand.
If a user uses this possibility, because the default of 125% is too crisp for him, he will get 120%, for example, if there are problems.
These problems only occur when the magnification is entered manually and they seem to occur at magnifications >100% to 125%.
Whether it also occurs at further magnifications must be tested, especially 120% is very bad, because this is often used.
It was very difficult to see what happens and why, because you don't know the context and only see the effect.
If such a scaling is chosen, the process is always DPI aware, even if it is disabled in the PB Compiler options.
This leads to layout corruption of different outputs, which a user or developer can almost not localize.
The functions for determining the scaling always return 100%, although it is e.g. 125%.
viewtopic.php?f=27&t=75348
Please check this once
Best regards Saki
it may not be that easy to and it took me a long time to crystallize it exactly.
So I've decided to post it here again because it's a very bad mistake.
Unfortunately I can't tell if it is a bug of the OS or PB.
But it is already more than helpful to know that he exists and what he does,
because it is almost impossible to find and locate him.
In Windows there are the extended scaling,
that is, where you can enlarge the desktop.
These are not those that are fixed, but those that have to be typed in by hand.
If a user uses this possibility, because the default of 125% is too crisp for him, he will get 120%, for example, if there are problems.
These problems only occur when the magnification is entered manually and they seem to occur at magnifications >100% to 125%.
Whether it also occurs at further magnifications must be tested, especially 120% is very bad, because this is often used.
It was very difficult to see what happens and why, because you don't know the context and only see the effect.
If such a scaling is chosen, the process is always DPI aware, even if it is disabled in the PB Compiler options.
This leads to layout corruption of different outputs, which a user or developer can almost not localize.
The functions for determining the scaling always return 100%, although it is e.g. 125%.
viewtopic.php?f=27&t=75348
Please check this once
Best regards Saki
地球上の平和
Re: Scaling Bug - DPI aware activates itself and break layou
Here a other test code
Code: Select all
Define wID=OpenWindow(#PB_Any, 0, 0, 610, 400, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Define font=LoadFont(#PB_Any , "Arial" , 26 , #PB_Font_Bold)
StartDrawing(WindowOutput(wID))
DrawText(0 , 10 , "Try scaling 125% with and without DPI aware Compiler option")
DrawText(0 , 30 , "First try the 125% that Windows offers directly in the scaling menu")
DrawText(0 , 50 , "Then switch to the extended scales and enter the 125% by hand again !")
DrawText(0 , 80 , "Compare the results and you will see the bug")
DrawingFont(FontID(font))
DrawText(0 , 120 , "You ever must see this line complete")
StopDrawing()
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
地球上の平和
Re: Scaling Bug - DPI aware activates itself and break layou
Do you get the same problem with this small change?
Code: Select all
Define wID=OpenWindow(#PB_Any, 0, 0, 610, 400, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Define font=LoadFont(#PB_Any , "Arial" , DesktopUnscaledY(26) , #PB_Font_Bold)
StartDrawing(WindowOutput(wID))
DrawText(0 , 10 , "Try scaling 125% with and without DPI aware Compiler option")
DrawText(0 , 30 , "First try the 125% that Windows offers directly in the scaling menu")
DrawText(0 , 50 , "Then switch to the extended scales and enter the 125% by hand again !")
DrawText(0 , 80 , "Compare the results and you will see the bug")
DrawingFont(FontID(font))
DrawText(0 , 120 , "You ever must see this line complete")
StopDrawing()
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
Re: Scaling Bug - DPI aware activates itself and break layou
Hi Demivec,
many thanks for testing, yes, the same.
Best regards Saki
many thanks for testing, yes, the same.
Best regards Saki
地球上の平和
Re: Scaling Bug - DPI aware activates itself and break layou
96 pixels / inch = 100% zoom.
120 pixels / inch =120/96= 125% zoom.
120 pixels / inch =120/96= 125% zoom.
my pb for chinese:
http://ataorj.ys168.com
http://ataorj.ys168.com
Re: Scaling Bug - DPI aware activates itself and break layou
Hi Gurj
This is not the Problem, try the test codes
这不是问题,请尝试测试代码
Best regards Saki
This is not the Problem, try the test codes
这不是问题,请尝试测试代码
Best regards Saki
地球上の平和
Re: Scaling Bug - DPI aware activates itself and break layou
That's a Windows behavior for unaware applications.
If you want correctly scaling enable DPI option.
Anyway, this is not a PB bug.
If you want correctly scaling enable DPI option.
Anyway, this is not a PB bug.
Re: Scaling Bug - DPI aware activates itself and break layou
Hi fryquez
It's not right what you write.
Please read firstly the thread and try the demo codes.
It is not about whether it is a PB or a Windows bug.
It's about the fact that it's a buggy behavior that causes massive problems and is very hard to localize.
And you as a PB and Windows user are directly affected.
It destroys the layouts of the users of your programs !
The name of this sub-forum ist Bugs - Windows, not PB-Bugs - Windows,
so it is the right place for this posts
Best regards Saki
It's not right what you write.
Please read firstly the thread and try the demo codes.
It is not about whether it is a PB or a Windows bug.
It's about the fact that it's a buggy behavior that causes massive problems and is very hard to localize.
And you as a PB and Windows user are directly affected.
It destroys the layouts of the users of your programs !
The name of this sub-forum ist Bugs - Windows, not PB-Bugs - Windows,
so it is the right place for this posts
Best regards Saki
地球上の平和
Re: Scaling Bug - DPI aware activates itself and break layou
The problem with the different DPIs on Windows is ever a headache The true is we don't have on PB a simple method to get the same interface on different DPIs
I test my code every time on different monitors on different DPIs an almost ever I need to adjust manually something.
I test my code every time on different monitors on different DPIs an almost ever I need to adjust manually something.
Re: Scaling Bug - DPI aware activates itself and break layou
Hi Caronte3D
I hate that DPI aware stuff,
he makes simple things complicated.
Switching older complex graphics software to DPI aware is more than an adventure,
it's annoying and you're tempted to throw everything out the window.
It should be up to the OS to provide high quality output, not up to the programmer.
Best regards Saki
I hate that DPI aware stuff,
he makes simple things complicated.
Switching older complex graphics software to DPI aware is more than an adventure,
it's annoying and you're tempted to throw everything out the window.
It should be up to the OS to provide high quality output, not up to the programmer.
Best regards Saki
地球上の平和
- Andre
- PureBasic Team
- Posts: 2058
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Scaling Bug - DPI aware activates itself and break layou
While I'm trying to adapt my project to be DPI-aware I have tested the example codes above and can confirm that there is something buggy with a 'manually set DPI scaling factor of 125%'.
While with 125% choosen in the related combobox in Windows settings (DPI-aware on + off) the text always is shown completely, with manually entered 125% and 'DPI-aware off' in the PB compiler settings the text doesn't fit into the window (see screenshot below).
Would be good, if Fred can take a look into the library code of the Desktop library, if there is something wrong or if we encountered a bug in the used WinAPI commands (workaround possible?)... Thank you
While with 125% choosen in the related combobox in Windows settings (DPI-aware on + off) the text always is shown completely, with manually entered 125% and 'DPI-aware off' in the PB compiler settings the text doesn't fit into the window (see screenshot below).
Would be good, if Fred can take a look into the library code of the Desktop library, if there is something wrong or if we encountered a bug in the used WinAPI commands (workaround possible?)... Thank you
Re: Scaling Bug - DPI aware activates itself and break layou
No, this sub-forum is for bugs in the Windows version of PureBasic. Not for Windows itself.Saki wrote:The name of this sub-forum ist Bugs - Windows, not PB-Bugs - Windows,
so it is the right place for this posts
Re: Scaling Bug - DPI aware activates itself and break layou
@BarryGAndre wrote: Would be good, if Fred can take a look into the library code of the Desktop library, if there is something wrong or if we encountered a bug in the used WinAPI
It would be very helpful if you could explain the cause of the bug and how to get rid of it !
地球上の平和
Re: Scaling Bug - DPI aware activates itself and break layou
Probably it is not only a PureBasic problem.
Have you done a research on this topic at microsoft.com?
==> https://support.microsoft.com/en-us/hel ... pi-devices
More information at blog.windows.com:
==> https://blogs.windows.com/windowsdevelo ... ktop-apps/
It is an very complex topic!
Have you done a research on this topic at microsoft.com?
==> https://support.microsoft.com/en-us/hel ... pi-devices
More information at blog.windows.com:
==> https://blogs.windows.com/windowsdevelo ... ktop-apps/
It is an very complex topic!
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
PB Last Final / Last Beta Testing
Re: Scaling Bug - DPI aware activates itself and break layou
Hi helpy,
many thanks.
Your postings are ever good and helpfull
Please look for this detail
Only the manually set scales >100% to 125% are affected
From 126% upwards it works properly again
Best regards Saki
many thanks.
Your postings are ever good and helpfull
Please look for this detail
Use we the combobox, all is OK, both should work at the sameAndre wrote: While with 125% choosen in the related combobox in Windows settings (DPI-aware on + off) the text always is shown completely, with manually entered 125% and 'DPI-aware off' in the PB compiler settings the text doesn't fit into the window (see screenshot below).
Only the manually set scales >100% to 125% are affected
From 126% upwards it works properly again
Best regards Saki
地球上の平和