iOS Question Static size of image regardless of plateform

Yvon Steinthal

Active Member
Licensed User
Hello,

So the title says it all, I am trying to show a picture in iOS that has exacly the same physical size on iPhone, iPad...
I am trying to find the DPI or PPI of each device but i am very much unsuccessful...
Any ideas?

Y.
 

Yvon Steinthal

Active Member
Licensed User
Hi Erel,

What i ended up doing, and correct me if im wrong in doing it this way.
I made a list of known device size (ex: 4.7',5.5',5.8'...) and used the good old math to figure a better approximate dpi.

B4X:
    Dim firstcrossoffsety As Double = size 'This is where i put the 4.7 or 5.5 , the ACTUAL size of the device
    Dim diagonal As Double = Power(GetDeviceLayoutValues.Width,2)+Power(GetDeviceLayoutValues.Height,2)
    diagonal = Sqrt(diagonal)
  
    Dim pixperinch As Double = diagonal / firstcrossoffsety
    Dim pixpermm As Double = pixperinch/25.4

I am showing a ruler, with millimeters, it needs to show the best measures regardless if its on a iPAD or iPHONE.
I can't use the "GetDeviceLayoutValues.DeviceApproximateScreenSize" as it returns a value that is not the real...

ex: returns 8.0 when in fact it should return 9.7

For users i added a Plus and Minus button in order to play with the size in the case my calculations are wrong on the first try.
 
Upvote 0
Top