V vinians Member Licensed User Longtime User Oct 8, 2012 #1 I want to scale the font correctly in a bunch of devices, so I want to know how to determine the size in inches of the diagonal of the screen?
I want to scale the font correctly in a bunch of devices, so I want to know how to determine the size in inches of the diagonal of the screen?
klaus Expert Licensed User Longtime User Oct 8, 2012 #2 Try this code: B4X: Sub GetDevicePhysicalSize As Float Dim lv As LayoutValues lv = GetDeviceLayoutValues Return Sqrt(Power(lv.Height / lv.Scale / 160, 2) + Power(lv.Width / lv.Scale / 160, 2)) End Sub Best regards. Upvote 0
Try this code: B4X: Sub GetDevicePhysicalSize As Float Dim lv As LayoutValues lv = GetDeviceLayoutValues Return Sqrt(Power(lv.Height / lv.Scale / 160, 2) + Power(lv.Width / lv.Scale / 160, 2)) End Sub Best regards.
Erel B4X founder Staff member Licensed User Longtime User Oct 9, 2012 #3 You can also use the new property: B4X: Log(GetDeviceLayoutValues.ApproximateScreenSize) However I recommend you to use AutoScaleAll instead: Supporting multiple screens - tips and best practices Upvote 0
You can also use the new property: B4X: Log(GetDeviceLayoutValues.ApproximateScreenSize) However I recommend you to use AutoScaleAll instead: Supporting multiple screens - tips and best practices