Application.SupportsHiDPI
From Xojo Documentation
This item was deprecated in version 2019r2. Please use Application.AllowHiDPI as a replacement. |
You can only set this property in the Inspector for the App object. Set to ON to make the app HiDPI-aware. This is set to True by default.
Notes
You can read this property at run-time:
When SupportsHiDPI is turned OFF, the framework will continue to work the way it did before. Images that use @2x or @3x in the name will have their PPI (points per inch) adjusted accordingly (144ppi, 216ppi).
You can turn the SupportsHiDPI property on or off dynamically by using an IDE Script. This turns it on:
Use the text "False" to turn it off.
When SupportsHiDPI is turned ON, the framework will NOT change the ppi when an image with @2x or @3x in its name is loaded. It is up to you to set the PPI (which is most easily handled using an Image Set). The reason for this is so that if you need access to the image's original PPI, you'll be able to get it by manually loading the image and setting is PPI.
If you want to set the PPI automatically based on its name, you can use this method:
Dim r As New RegEx
r.SearchPattern = "@([0-9.]+)x\."
Dim rm As RegExMatch = r.Search(filename)
If rm <> Nil And rm.SubExpressionCount > 0 Then
Dim n As Double = CDbl(rm.SubExpressionString(1))
p.HorizontalResolution = 72 * n
p.VerticalResolution = 72 * n
End If
End Sub