I seem to have very limited ability to draw stimuli using visual.ImageStim. Is there a way to crop the image based on user’s screen specifications? For example, say I have a .png, i scale it so that its twice as big (I know how to do this). But then can I crop it when it falls outside the user’s screen specifications?
I need to be able to do the following:
(1) Either embedd ImageStim in the same window.
(2) Be able to scale and crop.
OS : mac sierra 10.12.4 PsychoPy version (e.g. 1.84.x): 2020.2.3 Standard Standalone? (y/n) If not then what?: Built from scratch
The ImageStim can be re-sized simply by altering its .size property, but I think you are already able to do that.
“can I crop it when it falls outside the user’s screen specifications?” This isn’t really an issue. Just draw the stimulus - any portion that falls outside of the window won’t be seen. It doesn’t need to be actively cropped.
If you want to crop an image that appears entirely within the window, then you could use the Aperture class to do that. Define an Aperture with the cropped drawing area you want, then draw your stimulus. Only the portion within the Aperture bounds will be displayed. Then disable the Aperture so that subsequent drawing proceeds as normal. https://www.psychopy.org/api/visual/aperture.html
There is an aperture demo available from the Coder view’s Demos -> stimuli -> aperture.py menu