Announcement

Collapse
No announcement yet.

Keep Aspect Ratio of the Page/Window size

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Keep Aspect Ratio of the Page/Window size

    Hi, lately i have open a thread regarding resize and thanks to BioHazard for the given example. now my concern have no luck in solving it is how to keep the aspect ratio of the page?
    Looks like the same as object when your right click there is Keep Aspect and when check whenever the object width is resize the height also resize and i want to acheive that also in the page or window size..

    Can anybody help me? Thanks..

    Telco

  • #2
    i have found this https://forums.indigorose.com/forum/...sizing-windows

    Keeping the aspect ratio of a window is done by using some basic algebra.

    For example,

    We know that the ratio of the Width to the Height of a window sized at 1024 X 768 (respectively) is 4:3.

    Using this information we can then take either desired size measurement and apply a basic math function to it.

    If we want the Width to be 2000 then we apply the ratio to the height. Since we know the desired width and the aspect ratio, we can say...

    Height/3 = Width/4
    Height/3 = 2000/4
    Multiply Both sides by three to isolate the Height.
    Height = (2000/4)*3
    Height = (500)*3
    Height = 1500

    Test the result.
    1500/3 = 2000/4;
    500=500;

    So plug that into a simple function OnSize and there ya go.
    but can really understand how to implement it..

    Comment

    Working...
    X