Forums > Jitter

How to keep proportions in full screen mode?

December 15, 2013 | 12:19 pm

Hi everyone!

I am trying to project an image (using jit.qt.movie). When I enable full screen, the image stretches to fit the screen. I’m wondering what is the best way to preserve the proportions of the image so it’s not distorted? Black or white bars on the sides would work. I am (clearly) new to Max and I’ve been looking through the forums but I can’t find an answer to this question.

Thank you!


December 15, 2013 | 5:01 pm

I suggest to:
1) Use jit.displays to determine the width and height of the display where you want to see the movie fullscreen.
2) Set the size of your jit.window those dimensions.
and then either
3) Compare those dimensions to the dimensions of the movie you want to show.
4) Scale your movie by that ratio.
5) Center it in the jit.window.
or
3) Get the dimensions of your movie.
4) Use those dimensions to scale a jit.gl.videoplane to the proper aspect ratio and dimensions to fill the window.
5) Project your video onto the videoplane and render it.


December 16, 2013 | 11:08 am

easiest is jit.gl.cornerpin @preserve_aspect 1:

<code>

– Pasted Max Patch, click to expand. –

</code>


December 16, 2013 | 2:23 pm

Yes. Good example. Thx.


December 17, 2013 | 6:58 pm

Thanks so much for your suggestions!

For some reason I’m not understanding how to use the jit.gl.cornerpin, though it seems like it should work. Is it because I am not using opengl? My patch is just using jit.xfade to fade from one image (not a video but a still image though I am using jit.qt.movie) to another based on volume from sound input. Its pretty simple. I tried connecting jit.gl.cornerpin to my jit.qt.movie but it either does nothing,or, if I use the piece of code Ramirez sent, it glitches. Sorry I’m unable to be more articulate about what I’m doing. Do either of you know what I might be doing wrong?


Viewing 5 posts - 1 through 5 (of 5 total)