Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>getaspectratio() get current graphics mode's aspect ratio</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getaspectratio()        Get Current Graphics Mode's Aspect Ratio

 #include   <graphics.h>

 void far   getaspectratio(xasp,yasp);
 int far    *xasp;
 int far    *yasp;

    getaspectratio() gets the aspect ratio.  The ratio is not actually
    returned but can be calculated by dividing 'xasp' by 'yasp' for
    vertical correction or 'yasp' divided by 'xasp' for horizontal
    correction.  The aspect ratio is the scaling factor used by the
    graphics system to make symmetrical geometric objects come out
    symmetrical on the screen.

    Returns:    Nothing.

   -------------------------------- Example ---------------------------------

    The following statements draw a square on the screen.

           #include <graphics.h>
           #include <conio.h>

           main()
           {
               int gdriver = DETECT;
               int gmode;
               int xasp, yasp;
               long xlong;

               initgraph(&gdriver,&gmode,"");
               getaspectratio(&xasp,&yasp);
               xlong = (200L * (long)yasp)/(long)xasp;
               rectangle(100,100,(int)xlong,200);
               getch();
               closegraph();
           }


See Also: arc() circle() ellipse() getarccoords() pieslice()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson