# Full screen stimuli

**URL:** <https://discourse.psychopy.org/t/full-screen-stimuli/31326>\
**Category:** Coding\
**Tags:** screen\
**Created:** [October 12, 2022, 12:41pm UTC](https://discourse.psychopy.org/t/full-screen-stimuli/31326 "2022-10-12T12:41:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TChauhan](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@TChauhan](https://discourse.psychopy.org/u/TChauhan)\
**Post date:** [October 12, 2022, 12:41pm UTC](https://discourse.psychopy.org/t/full-screen-stimuli/31326/1 "2022-10-12T12:41:23Z")

</div>

Hi,

I am trying to build an experiment where I want the stimuli to go fullscreen, no matter where the experiment is deployed (i.e., irrespective of the screen size). I am not able to figure out how to do this.

I am also wondering, does someone here code their own stimuli from scratch? Is there an API for it? For instance, do the stimuli have to be in the form of a function that takes time as an input and spits out a matrix of the required size as output?

I am more comfortable writing code than using the GUI. Any help such as links, references, or code snippets would be super helpful.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![Christophe\_Bossens](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/christophe_bossens/32/35415_2.png) [@Christophe\_Bossens](https://discourse.psychopy.org/u/Christophe_Bossens)\
**Post date:** [October 13, 2022, 3:27pm UTC](https://discourse.psychopy.org/t/full-screen-stimuli/31326/2 "2022-10-13T15:27:48Z")

</div>

Do you have a specific stimulus in mind (e.g., ImageStim, GratingStim)?

One solution that comes to mind is to get the screen size after you have created a window, and use that size for the size parameter of each stimulus that you want (this solution assumes that you are using PsychoPy as a package):

```auto
from psychopy import visual, event

w = visual.Window(size = (700, 700), units = 'pix')

im = visual.ImageStim(w, r'image_file.jpg', size=w.size)

```

---

<div class="post-metadata">

**Author:** ![TChauhan](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@TChauhan](https://discourse.psychopy.org/u/TChauhan)\
**Post date:** [October 24, 2022, 1:24pm UTC](https://discourse.psychopy.org/t/full-screen-stimuli/31326/3 "2022-10-24T13:24:28Z")

</div>

Hi Christophe,

Thank you for the reply. I think I’ve figured out a sub-optimal way of doing this. I just `draw()` the stimuli at a very large size, and then `flip()` that on the screen. I think it’s a bit wasteful, but I can’t think of another way since the same script will be used on various monitors and they all need to display the stimuli fullscreen. I’m using the `GratingStim` function to draw the stimuli.

Cheers
