Page 1 of 1
Strange DPI-conscious behavior, as an example at 120% Sca
Posted: Sun May 17, 2020 11:03 pm
by Saki
Hi all
Strange behavior.
Please test it once.
For example, if the Windows 10 scaling is set to 120% (also various enhanced other scales),
Process is DPI aware, even if it is disabled in the PB Compiler options !
Best regards Saki
Re: Strange DPI-conscious behavior, as an example at 120% Sc
Posted: Mon May 18, 2020 8:33 am
by Saki
I forgot to write a sample.
You can test it with this code :
Code: Select all
library=OpenLibrary(#PB_Any, "user32.dll")
If library
If CallFunction(library, "IsProcessDPIAware")
CloseLibrary(library)
Debug "Process is DPI aware"
Else
Debug "Process is not DPI aware"
EndIf
Else
Debug "Can not open library"
EndIf
Strange DPI-conscious behavior, as an example at 120% Sca
Posted: Tue May 19, 2020 1:00 pm
by Saki
It was hard to understand.
But it is now clear what it is, it is only the advanced Windows OS scaling.
The problem is up to scaling 125%
If you use the default scalings, everything is OK and DPI aware is also disabled when it is disabled in the PB compiler options.
This can be due to PB or the OS ?
Anyway, it is a very bad bug which destroys formatting and scaling.
Added a other test code for better understanding the bug :
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
Best regards Saki