This probably an easy one and I’m just having a moment.
Is there a way to detect if you application is running on a machine with a HiDPI display? I thought about using the Canvas ScaleFactor property or ScaleFactorChanged event without luck.
My old 2013 27" iMac doesn’t have a Retina display but I got a 28" HiDPI display for my new Mac mini and I can certainly see that my app is using the hi-res images on my Canvas Buttons.
Would be nice to know though so I could do some programatic changes at some point…
Why do you want to know this, just for curiosity sake or are you planning to draw different graphics for different resolutions?
The Apple recommend way is to use API that Xojo doesn’t expose and to do this for each control.
It is possible to have a window ride multiple displays at which point the window adopts the highest resolution, but each control may not.
However if you stick to using points instead of pixels and standard functionality, the macOS will handle this for you.
This is a scaling factor, so a normal screen would be 1. However do not assume that it will always be 1, 2 or 3. Windows offers intermediate sizes and Apple may also in the future (technically some of their screens are already at intermediate sizes, but they fake with software).
Just for curiosity sake really. I like learning new things and seeing what can be done with them. I use image sets for my canvas buttons and they work great on HiDPI displays. Even better now that I replaced the supplied HDMI cable with a Thunderbolt 4 to DisplayPort cable…