Scaling ofVideoGrabber to fullscreen and maintaining aspect ratio

Apologies for potentially vaguely formulated question, but…

What is the best way to capture video at the webcam’s native resolution and display it fullscreen maintaining original aspect ratio, either cropping or with black bars?

Any ideas / references / rtfm links are highly appreciated.

Konstantin

Check out this example:

https://github.com/openframeworks/openFrameworks/tree/master/examples/graphics/rectangleAlignmentAndScaling

That, in combination with ofGetWitdth/ofGetHeight() and the width/height from your video player should do the trick.

1 Like

It is also done here:

1 Like

Nice one! Works like a charm, thank you!

1 Like