How to handle iPhone screen sizes with MergAV

65 views Asked by At

I'm trying to build a small iOS app using MergAV to scan QRCodes. The only thing that troubles me is that if I create the app based on iPhone 5 screen size everything works OK. Even on the bigger screens! But If I start out with an iPhone 6 sized stack I need to add:

set the fullscreenmode of this stack to "ShowAll"

Otherwise the stack will be to big on an iPhone 6 or 7. This is strange in itself but manageable. After the line above my stack tells that the scaleFactor is 1 and the systemPixelScale is 2 (as expected) but when I set the rect of the "camera" via:

mergAVCamSet "rect",the rect of grc "cam"

the camera doesn't get the correct rect. It is offset slightly down-left and is higher than the original rect. If I on the other hand query the rect of the graphic and the rect of the camera via mergAVCamGet("rect") the first three numbers are the same but the last (bottom value) differs and the cam actually have a lower number!

Is this a bug? Something I should know? Something I can workaround?

1

There are 1 answers

1
anilhavuc On
function realDeviceSize pParam
   local nX, nY
   put item 3 of the screenRect / item 3 of the effective rect of this stack into nX
   put item 4 of the screenRect / item 4 of the effective rect of this stack into nY
   put the round of (item 1 of pParam * nX) into item 1 of pParam
   put the round of (item 2 of pParam * nY) into item 2 of pParam
   put the round of (item 3 of pParam * nX) into item 3 of pParam
   put the round of (item 4 of pParam * nY) into item 4 of pParam
   return pParam
end realDeviceSize

on preOpenCard
   put realDeviceSize(the rect of image "iRectangle") into tCameraRect
end preOpenCard