D danoptic Member Licensed User Longtime User Jan 14, 2012 #1 I need to have an image with the exact physical display size on every phone or tablet. Do you have an example to do that? Dan
I need to have an image with the exact physical display size on every phone or tablet. Do you have an example to do that? Dan
W wl Well-Known Member Licensed User Longtime User Jan 14, 2012 #2 Have a look at the excellent manual written by klaus and erel (5. Screen and sizes on p.71 of version 1.6 of the beginners manual) I guess you will need to do some calculations and resizing based on these values. Wim Upvote 0
Have a look at the excellent manual written by klaus and erel (5. Screen and sizes on p.71 of version 1.6 of the beginners manual) I guess you will need to do some calculations and resizing based on these values. Wim
Erel B4X founder Staff member Licensed User Longtime User Jan 15, 2012 #3 The following code uses reflection to extract the exact horizontal and vertical dpi (dots per inch) values: Code: Copy Sub Activity_Create (FirstTime As Boolean) Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod("getResources") r.Target = r.RunMethod("getDisplayMetrics") Log(r.GetField("xdpi")) Log(r.GetField("ydpi")) End Sub Upvote 0
The following code uses reflection to extract the exact horizontal and vertical dpi (dots per inch) values: Code: Copy Sub Activity_Create (FirstTime As Boolean) Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod("getResources") r.Target = r.RunMethod("getDisplayMetrics") Log(r.GetField("xdpi")) Log(r.GetField("ydpi")) End Sub
K Kapelis Member Licensed User Longtime User May 25, 2014 #4 Erel said: The following code uses reflection to extract the exact horizontal and vertical dpi (dots per inch) values: Code: Copy Sub Activity_Create (FirstTime As Boolean) Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod("getResources") r.Target = r.RunMethod("getDisplayMetrics") Log(r.GetField("xdpi")) Log(r.GetField("ydpi")) End Sub Click to expand... Thank you very much Erel, I solved the problem Upvote 0
Erel said: The following code uses reflection to extract the exact horizontal and vertical dpi (dots per inch) values: Code: Copy Sub Activity_Create (FirstTime As Boolean) Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod("getResources") r.Target = r.RunMethod("getDisplayMetrics") Log(r.GetField("xdpi")) Log(r.GetField("ydpi")) End Sub Click to expand... Thank you very much Erel, I solved the problem
K Kapelis Member Licensed User Longtime User May 25, 2014 #5 wl said: Have a look at the excellent manual written by klaus and erel (5. Screen and sizes on p.71 of version 1.6 of the beginners manual) I guess you will need to do some calculations and resizing based on these values. Wim Click to expand... Thank you very much, I solved the problem with your and Erel's advice. Upvote 0
wl said: Have a look at the excellent manual written by klaus and erel (5. Screen and sizes on p.71 of version 1.6 of the beginners manual) I guess you will need to do some calculations and resizing based on these values. Wim Click to expand... Thank you very much, I solved the problem with your and Erel's advice.