Comments (3)
There are 2 parts to this:
- The first is how to get the full height of the screen which is best achieved using either height or norm units rather than pixels (then you don't need to query the screen etc). Either use height units and set the hegiht to be 1 (because you want 1 screen height high) or use norm units and set the height to be 2 (because the screen ranges -1:1 so it's full height is 2 units long)
- The second issue is how to scale the width by the same amount as the height. We added the option (certainly to images but I think to movies as well) that you can set a dimension to be
None
and it will then happily rescale to fit the other dimension
When you put those 2 things together you should be able to do this relatively easily:
units = 'height'
size = [None, 1]
to get a full-height, original ratio movie with no code required
from psychopy.
Update: I checked and it looked like this was only implemented for images. We'll look to add that probably for the summer 2024 release
And it doesn't have the flexibility to check first which dimension is the larger - you need to decide that yourself in advance. I'm not sure what the best way would be to allow the full version of what you're requesting in the current user interface. As in, where would we put the selection option(s) for "full-screen rescale" or "full-screen stretch"?
from psychopy.
Update: I checked and it looked like this was only implemented for images. We'll look to add that probably for the summer 2024 release
And it doesn't have the flexibility to check first which dimension is the larger - you need to decide that yourself in advance. I'm not sure what the best way would be to allow the full version of what you're requesting in the current user interface. As in, where would we put the selection option(s) for "full-screen rescale" or "full-screen stretch"?
My apologies on the poor code example! The github code feature doesn't agree with my code, as I'm using ' instead of " in my code!
I noticed what you mentioned aswell that it does not have the flexibility to check the size first. When going to get the size of the stim, you must also get the stim clip size only after it's already loaded.
Personally I would either have another drop select before the size to determine if it is "Shrink to fit", "stretch to fit", or "shrink or stretch to fit" if either is selected then there's an option to maintain original aspect ratio.
I figure it should go almost first because if you maximize the video size, you're basically guaranteeing that it's going to be centered, and the spatial units don't matter. Neither would the anchor.
To make it a less confusing experience, I would have the dialog box dynamically remove the extreneous options when one of these features is enabled.
I've only taken a brief look under the psychopy hood and I'm not yet sure if it can easily be made dynamic, this option window. I've had success using TKinter to make these kinds of windows with options that dynamically change, but I believe that this window uses WXPython, and I'll have to become familiar with this in the future before I can really know for sure.
Basically have a box at the top like this:
If you select shrink or stretch to fit, everything unneeded disappears and you get a checkbox:
I hope this makes sense! Probably poor examples! But just the idea that it can come first. A checkbox can be used to activate this mode first. If this checkbox isn't selected, the rest of the menu stays the exact same.
from psychopy.
Related Issues (20)
- [Bug]: Can't run PsychoPy after conda installation on Mac Sonoma HOT 6
- [Bug]: PsychPy is unable to load images from a public online source. Specifically, it is unable to load an image from a public AWS s3 bucket, as in: https://neurotype-images.s3.us-east-2.amazonaws.com/affective-images/004504.jpg HOT 4
- psychopy components can't open [Bug]: HOT 15
- [Bug]: Extremely slow rendering of colors HOT 2
- [Bug]: Editable TextBox2 line spacing contamination HOT 2
- [Bug]: Pandas version differs across operating systems HOT 1
- [Bug]: 2024.1.1 is packaged with Python 3.8.x but will not run locally with said version HOT 2
- [Bug]: Two Counterbalance routines with the same name can be added / Conditions file is not updated in Counterbalance routine
- [Bug]:
- [Bug]: System default audio device not used in versions >= 2024
- [Bug]: `Dlg` example raises an exception HOT 2
- Is the entire `pyobjc` package collection required? HOT 1
- [Bug]: Use of pythonw on macos conda/mamba environments breaks app HOT 4
- [Bug]: Space character in column name of conditions file yields `UnboundLocalError` in Builder HOT 1
- [Bug]: Mistake in documentation for FormComponent
- [Bug]: OverflowError: line number table is too long
- [Bug]: pkg_resources is deprecated
- [Bug]: crash after launch on Ubuntu 22.04
- [Bug]: Not able to connect to my Pavlovia account when running local psychopy version HOT 4
- [Feature Request]: Using serial port without access to the port HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psychopy.