How do I get the real width and height of my screen?

I knock my head on the walls since yesterday evening on a problem.
How do I display a 2000 pixels image (width) on a 3360 pixels wide screen.

I used the code below as I dispair and this hurts:

  System.DebugLog "Screen(0) size: " + Str(Screen(0).Width) + "," + Str(Screen(0).Height) + "."
  // Returns: 1680,1050

While the screen shot creates a 3360 x 2100 image…

Nota: this is meant to be used on all three platforms (mostly Windows), but developped on a MacBook Pro.

Xojo 2015r1 / 2019r1.1 (both share the same trouble).

Multiple with screen(0).scale to get pixel count.

width and height are in point. But with retina resolution one point is multiple pixels.

Thank you Christian.

These numbers are the numbers Apple advertise; Retina values, you are right.

But my Display Control panel s set differently to get the double in screen display.

Drats !

ScaleFactor does not exists yet in 2015r1 !

It is “New in 2018r4” and my hardware is a
“MacBook Pro (Retina, 13 inches, mid-2014)”

Usually, I either found a workaround or trash the feature, but I cannot do that in this case.

This is one of the reasons I never upgraded my license :blush:

It tooks me one hour to get the Apple instruction below:
https://developer.apple.com/documentation/appkit/nsscreen/1388385-backingscalefactor

I need the same for the other platforms / help to translate that into Xojo.

Someone ?

Use NSScreenMBS in MBS Xojo Plugins and the backingScaleFactor property.