How to find aspect ratio of a width

Discussion in 'Programming' started by Kippykip, Dec 15, 2014.

  1. Kippykip

    Kippykip Get out of my kitchen you flying ass God King

    Messages:
    518
    Likes Received:
    10
    Gender:
    Male
    Mood:
    Pissed off
    THIS IS HOW
    I couldn't find this anywhere and guessed it when I saw the 4:3 ratio thingys

    This is how...
    Ready for this??

    Say we have 640x480
    We want to find 480 with just the 640 number
    We know it's a 4:3 resolution but what does this mean?

    You do:
    Code:
    640 / 4 * 3
    That's how...

    You divide by the first number which would be
    Code:
    640 / 4 = 160
    Then you times it by the 2nd number
    Code:
    160 * 3 = 480
    TADA! Lets try this on another ratio
    Lets find the 16:9 resolution from 1920

    Code:
    1920 / 16 * 9 = 1080
    HOPE THIS HELPS IN YOUR WIDESCREEN RATIO DETECTION AHAW
     
  2. NecroWolf

    NecroWolf Active Lad Member

    Messages:
    82
    Likes Received:
    1
    That's more on verifying than detecting it. Just divide width by height and refer to this chart:

    1.33:1 = ( 4:3 )
    1.78:1 = ( 16:9 )
    1.85:1 = ( 37:20 )
    2.20:1 = ( 11:5 )
    2.35:1 = ( 47:20 )
     
  3. Kippykip

    Kippykip Get out of my kitchen you flying ass God King

    Messages:
    518
    Likes Received:
    10
    Gender:
    Male
    Mood:
    Pissed off
    Well yeah verifying is what I meant.
    I used it in my game to find out what aspect ratio the game resolution is in so it can scale images and change the fov accordingly
     

Share This Page