Sketch doesn't scale right with size() function

Hey there,
lately i got an new surface 8pro, and i directly wanted to start coding on it as well as on my desktop work station.
But there is a problem, because the sketch on the new laptop does not run with the correct size:

the surface (windows 11) has a screen resolution of (2880x1920 Pixels) and is scale in the display settings is 200%. If im running a program with only 1400x800 pixels its almost full screen.

this problem i never had on my desktop display, which is a 4k monitor, and is scaled by 175% in the display settings on windows 10.

does anyone have any idea how, i can run a sketch on the surface, that has exactly the right height and width in Pixels?

thank you very much in advance, if my explanation was not understandable pls dont hesitate to ask questions. (and sorry for my english, which i know isnt very good)

Instead of size() try surface.setSize(), im not sure if that will help but seen a similar question the other day and trying to see if it helps

hey Mikey,
thanks for your answer, but sadly it did not work for me.
I tried to implement it in the settings and in the setup method,but neither did work -.-
If you have any other advice i would love to hear it.

Thats sad then, are you using version 4? the issue the other person was having seemed to be with 4, maybe something in the core program thats clashing with windows 11 as they were using that too

1 Like

Oh yes, that actually might be the problem, since I’m still using the version 3 on my desktop pc but downloaded version 4 for the surface.

I’ll try it when I’m back home.

It might also be something related to hires displays have a look at pixelDensity, try values 1 or 2 and see if that helps.

@quark i have tried your idea first in the latest processing4 version, but it did not changed the sketch size in pixels or the pixeldensity in the sketch, only the shapes the sketch draws got somehow bigger.
But thanks for the idea anyway.

@Mikey83 With the latest processing 3 Version it works fine. Thank you very much for the hint. Do you know where i can report this little bug?

1 Like

@karo im sure it has already been reported numerous times, clearly its a compatibility issue, whether thats on windows 11 or processing 4’s side, i couldn’t tell you, but there does seem to be an issue

1 Like

Hello @karo,

Related topic here:

You may find an issue in here:

:)