Millisecond Forums

How does size attribute (in percentage) work when the screen does not have 1920 x 1080 resolution?

https://forums.millisecond.com/Topic29219.aspx

By KatrinaMcDonough - 6/12/2020

I thought the size attribute as a percentage was a percentage of the display size but this does not seem to be the case, at least for the Y axis, when the screen is not at a 1920 x 1080 resolution. 

I made a rectangle that was size = (50%, 50%) and position (50%, 50%). Therefore, as far as I understand, the four corners of the rectangle should be A(25%, 25%), B(75%, 25%), C(25%, 75%), D(75%, 75%).
When my screen resolution was 1920 x 1080, this seems to be correct. The pixel coordinates for these positions were A(480, 270), B(1440, 270), C(480, 810), D(1440, 810).

However, when my screen resolution was 1280 x 1024, the pixel coordinates for the four corners were A(320, 330), B(960, 330), C(320, 690), D(960, 690),
which in percentages, equates to A(25%, 32%), B(75%, 32%), C(25%, 67%), D(75%, 67%). So this suggests the size of the rectangle is actually (50%, 35%). 

In another example, I used the resolution 1440 x 900, and the pixel coordinates for the four corners were: (A(360, 250), B(1080, 250), C(360, 650), D(1080, 650), 
which in percentages, equates to A(25%, 27%), B(75%, 27%), C(25%, 72%), D(75%, 72%). So this suggests the size of the rectangle is actually (50%, 45%).

It looks like size on the X axis is correctly scaled to the display width, but the size on the Y axis is not scaled to the display height.

Can anyone help me to understand this?
Thanks

By Dave - 6/12/2020

KatrinaMcDonough - 6/12/2020
I thought the size attribute as a percentage was a percentage of the display size but this does not seem to be the case, at least for the Y axis, when the screen is not at a 1920 x 1080 resolution. 

I made a rectangle that was size = (50%, 50%) and position (50%, 50%). Therefore, as far as I understand, the four corners of the rectangle should be A(25%, 25%), B(75%, 25%), C(25%, 75%), D(75%, 75%).
When my screen resolution was 1920 x 1080, this seems to be correct. The pixel coordinates for these positions were A(480, 270), B(1440, 270), C(480, 810), D(1440, 810).

However, when my screen resolution was 1280 x 1024, the pixel coordinates for the four corners were A(320, 330), B(960, 330), C(320, 690), D(960, 690),
which in percentages, equates to A(25%, 32%), B(75%, 32%), C(25%, 67%), D(75%, 67%). So this suggests the size of the rectangle is actually (50%, 35%). 

In another example, I used the resolution 1440 x 900, and the pixel coordinates for the four corners were: (A(360, 250), B(1080, 250), C(360, 650), D(1080, 650), 
which in percentages, equates to A(25%, 27%), B(75%, 27%), C(25%, 72%), D(75%, 72%). So this suggests the size of the rectangle is actually (50%, 45%).

It looks like size on the X axis is correctly scaled to the display width, but the size on the Y axis is not scaled to the display height.

Can anyone help me to understand this?
Thanks


I'm completely unable to reproduce this, I'm afraid. Here's the very simple test code I used, which should be in line with yours

<trial mytrial>
/ stimulusframes = [1=myshape, resolution]
/ validresponse = (57)
/ screencapture = true
</trial>

<shape myshape>
/ shape = rectangle
/ color = lightblue
/ position = (50%, 50%)
/ size = (50%, 50%)
</shape>

<text resolution>
/ items = ("<%display.width%> x <%display.height%>")
/ position = (50%, 5%)
</text>

and attached below are three screen captures across three different screen resolutions. In every case, as far as I can determine, the pixel coordinates and dimensions are correct and exactly what should be expected under the given screen resolution.
By KatrinaMcDonough - 6/12/2020

Thanks for the quick reply! Yours seems to work fine when you draw the rectangle in inquisit, I actually just used an image of a rectangle:

<trial mytrial>
/ stimulusframes = [1=myshape, resolution]
/ validresponse = (57)
/ screencapture = true
</trial>


<picture myshape>
/ items = ("box.jpg")
/ position = (50%, 50%)
/ size = (50%, 50%)
</picture>


<text resolution>
/ items = ("<%display.width%> x <%display.height%>")
/ position = (50%, 5%)
</text>



By Dave - 6/12/2020

KatrinaMcDonough - 6/12/2020
Thanks for the quick reply! Yours seems to work fine when you draw the rectangle in inquisit, I actually just used an image of a rectangle:

<trial mytrial>
/ stimulusframes = [1=myshape, resolution]
/ validresponse = (57)
/ screencapture = true
</trial>


<picture myshape>
/ items = ("box.jpg")
/ position = (50%, 50%)
/ size = (50%, 50%)
</picture>


<text resolution>
/ items = ("<%display.width%> x <%display.height%>")
/ position = (50%, 5%)
</text>




> Yours seems to work fine when you draw the rectangle in inquisit, I actually just used an image of a rectangle:

Ah, yes. That explains it then. Inquisit will not distort the original image's inherent aspect ratio. That's the intended behavior. Your box image is 1920 x 1080 pixels, so 16:9 aspect ratio, and that will be preserved.
By KatrinaMcDonough - 6/12/2020

Makes total sense!
Thank you for your help