The canvasSize attribute defines the maximum width and height of the bounding rectangle within which visual stimuli are positioned on the screen.
<defaults>
or
/ canvasSize = (widthexpression, heightexpression)Name | Type | Description |
---|---|---|
width | extent | The width of the canvas in pixels (default), percent, or points. |
height | extent | The height of the canvas in pixels (default), percent, or points. |
widthexpression | value | An expression resolving to the width of the canvas in pixels (default), percent, or points. If width is set to null and a height is specified, the width is set to the pixel size of the height. |
heightexpression | value | An expression resolving to the height of the canvas in pixels (default), percent, or points. If height is set to null and a width is specified, the height is set to the pixel size of the width. |
The canvasSize attribute can be used in combination with the canvasAspectRatio and canvasPosition attributes to define a rectangle on the screen relative to which all visual stimuli and sized and positioned. These attributes that the relative size and position of stimuli on the screen remains the same across monitors of different shapes and sizes..
The following ensures that visual stimuli are presented in a rectangle that has the same proportions as an 8.5 x 11 inch sheet of paper and with margins around the screen no smaller than 20%.
<defaults>
/ canvasSize=(80%, 80%)
/ canvasAspectRatio=(8.5, 11)
</defaults>