It is currently Tue Mar 09, 2021 9:52 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: [Solved] DPI aware scaling bug 5.73
PostPosted: Tue Dec 08, 2020 9:07 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 518
Location: Pandora
DPI aware scaling bug, important 5.73

While working on the new FontMaster I suddenly noticed that the
OS automatic upscaling did no longer work for scales over 100%.
Restarting the OS and reinstalling PB does not help.

Reducing the code down to pure OpenWindow did not help either.
Copying the code into a new file eliminates the problem.
Then you have two exactly same small codes.
Upscaling works with one but not with the other.

PB does not forget the defective file, the mechanism behind it is unknown to me.
If you create exe from both files, the error is gone.

Another method to remove the error you can see in the gif.
The code is started in the degugger, then it is started a second time with the separate debugger.
By this second start with the separate debugger the error is removed.

I athink that the error is triggered when a code is started with a windowed screen in DPI aware.

Now I know why many people have problems with DPI aware and want the constant to prompt them to switch on DPI aware.

If DPI aware is implemented correctly it does not matter if it is switched on in the compiler or not, the sizes are always the same.

But with this error you can drive everyone almost crazy.

Most people are unlikely to recognise the cause, as they are not familiar with DPI aware

I made a little code,
A very strange thing, but very bad.
I have seen this error several times, with different codes, but I have never been able to find the cause and a way to remove.
It probably has something to do with the debugger..

If you cannot compare the results it is very difficult and annoying to program DPI aware.
Especially such tools must run without problems with and without DPI aware, otherwise they cannot
be used in any other codes.

Code:
InitSprite()
Define window_ID=OpenWindow(#PB_Any, 0, 0, 960, 470,
                            "",
                            #PB_Window_ScreenCentered|#PB_Window_SystemMenu)
    Define canvas_2_ID=OpenWindowedScreen(WindowID(window_ID),
                                          0, ; output_x
                                          0,  ; output_y
                                          960*DesktopResolutionX(), ; gadget_width
                                          470*DesktopResolutionX()) ; gadget_height
  Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow


Image

Image

_________________
地球上の平和


Last edited by Saki on Wed Dec 09, 2020 9:24 pm, edited 6 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: DPI aware scaling bug 5.73
PostPosted: Wed Dec 09, 2020 11:42 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 518
Location: Pandora
Gif above updated to simplest code using.

_________________
地球上の平和


Last edited by Saki on Wed Dec 09, 2020 9:24 pm, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: DPI aware scaling bug, important 5.73
PostPosted: Wed Dec 09, 2020 4:02 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 4:34 pm
Posts: 1045
Location: Canada
Using your code posted I cannot reproduce your issue.
The window is displayed the same size regardless of DPI aware settings or whether standalone debugger is used.

_________________
Image Image


Top
 Profile  
Reply with quote  
 Post subject: Re: DPI aware scaling bug 5.73
PostPosted: Wed Dec 09, 2020 6:00 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 518
Location: Pandora
Thanks Paul.
I have now reset Windows to my last OS backup and restored the latest updates.
At the moment the bug is gone.
It seems that the automatic import of the latest OS updates has broken something on the system.
If it happens again I will post again.
In any case a very bad thing and absolutely strange.
If you would not see the gif, you would not believe it.

_________________
地球上の平和


Top
 Profile  
Reply with quote  
 Post subject: Re: [Solved] DPI aware scaling bug 5.73
PostPosted: Thu Dec 10, 2020 8:05 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jul 17, 2017 7:22 am
Posts: 100
Location: Cotswolds England
Saki, Nothing to do with your DPI issue, just asking which software you used in the demo on your post. :)

_________________
If it's falling over......just remember the computer is never wrong!


Top
 Profile  
Reply with quote  
 Post subject: Re: [Solved] DPI aware scaling bug 5.73
PostPosted: Thu Dec 10, 2020 10:21 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 518
Location: Pandora
C87 wrote:
Saki, Nothing to do with your DPI issue, just asking which software you used in the demo on your post. :)

Hi C87, here :
https://www.purebasic.fr/english/viewtopic.php?f=12&t=76338&p=562401#p562401

_________________
地球上の平和


Top
 Profile  
Reply with quote  
 Post subject: Re: [Solved] DPI aware scaling bug 5.73
PostPosted: Thu Dec 10, 2020 12:16 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jul 17, 2017 7:22 am
Posts: 100
Location: Cotswolds England
Hello again Saki, I maybe wasn't so clear. :oops:
I was referring to the demo-type application that you use to animate the initial posts.
In the page you show it as if you are operating the screen in the post.
Sorry about that but many thanks in advance

_________________
If it's falling over......just remember the computer is never wrong!


Top
 Profile  
Reply with quote  
 Post subject: Re: [Solved] DPI aware scaling bug 5.73
PostPosted: Thu Dec 10, 2020 12:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Apr 05, 2020 11:28 am
Posts: 518
Location: Pandora
Hi, no problem, look here :
https://www.screentogif.com/

_________________
地球上の平和


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Henry00 and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye