little3399 Active Member Licensed User Longtime User Jun 4, 2014 #1 Hi , I found the DevicePhysicalSize seem maybe incorrect , here is my code and the result : my code: Dim lv As LayoutValues lv = GetDeviceLayoutValues Label1.Text="ApproximateScreenSize:" Label2.Text=lv.ApproximateScreenSize Label3.Text="Scale:" Label4.Text=lv.Scale Label5.Text="Height:" Label6.Text=lv.Height Label7.Text="Width:" Label8.Text=lv.Width Label9.Text="DevicePhysicalSize:" Label10.Text=Scale.GetDevicePhysicalSize result: My question is they are all correct ?
Hi , I found the DevicePhysicalSize seem maybe incorrect , here is my code and the result : my code: Dim lv As LayoutValues lv = GetDeviceLayoutValues Label1.Text="ApproximateScreenSize:" Label2.Text=lv.ApproximateScreenSize Label3.Text="Scale:" Label4.Text=lv.Scale Label5.Text="Height:" Label6.Text=lv.Height Label7.Text="Width:" Label8.Text=lv.Width Label9.Text="DevicePhysicalSize:" Label10.Text=Scale.GetDevicePhysicalSize result: My question is they are all correct ?
Erel B4X founder Staff member Licensed User Longtime User Jun 4, 2014 #2 It is the same as GetDeviceLayoutValues.ApproximateScreenSize. As it name suggests this is an approximation based on the reported dimensions. It is based on Pythagoras theorem: Size = ((Width / 160 / Scale) ^ 2 + (Height / 160 / Scale) ^ 2) ^ 0.5 It is an approximation because the scale is not exact. Upvote 0
It is the same as GetDeviceLayoutValues.ApproximateScreenSize. As it name suggests this is an approximation based on the reported dimensions. It is based on Pythagoras theorem: Size = ((Width / 160 / Scale) ^ 2 + (Height / 160 / Scale) ^ 2) ^ 0.5 It is an approximation because the scale is not exact.
little3399 Active Member Licensed User Longtime User Jun 4, 2014 #4 Is there exist a simple way or formula to caluate a dip unit length? Upvote 0
klaus Expert Licensed User Longtime User Jun 4, 2014 #5 dips are based on the 'standard' resolution of 160 dpi (dots per inch) so 1 dip = 1'' / 160 = 0.00625'' or 25.4 / 160 = 0.159mm Last edited: Jun 4, 2014 Upvote 0
dips are based on the 'standard' resolution of 160 dpi (dots per inch) so 1 dip = 1'' / 160 = 0.00625'' or 25.4 / 160 = 0.159mm
little3399 Active Member Licensed User Longtime User Jun 4, 2014 #6 24.5/160 ,24.5 on behalf of what? TKS! Upvote 0
klaus Expert Licensed User Longtime User Jun 4, 2014 #7 24.5 should be 25.4 1 inch = 25.4 mm (millimeters). Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jun 4, 2014 #9 Note that you can get the exact scale values with the code posted here: http://www.b4x.com/android/forum/threads/same-physical-display-size.14037/#post-79434 (as reported by the device). Upvote 0
Note that you can get the exact scale values with the code posted here: http://www.b4x.com/android/forum/threads/same-physical-display-size.14037/#post-79434 (as reported by the device).