# Scaling, keeping aspect ratio

**URL:** <https://forum.kirupa.com/t/scaling-keeping-aspect-ratio/251051>\
**Category:** Uncategorized\
**Created:** [February 4, 2008, 11:12pm UTC](https://forum.kirupa.com/t/scaling-keeping-aspect-ratio/251051 "2008-02-04T23:12:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geestring](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@geestring](https://forum.kirupa.com/u/geestring)\
**Post date:** [February 4, 2008, 11:12pm UTC](https://forum.kirupa.com/t/scaling-keeping-aspect-ratio/251051/1 "2008-02-04T23:12:39Z")

</div>

I have this video background, and I want its aspect ratio to be kept intact when the window is resized. Also I want the screen fiiled, if the aspect ratio would make the video smaller than the window it won’t resize, it would just center.

[http://pastebin.com/d2ae5a82d](http://pastebin.com/d2ae5a82d)

I have that code, it gives you an idea of what I want.  
however its buggy and flickers.
