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>getmaxy() get the current y resolution</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getmaxy()               Get the Current y Resolution

 #include   <graphics.h>

 int far    getmaxy(void);

    getmaxy() returns the maximum y screen coordinate for the current
    graphics mode. This function is very useful for positioning text and
    graphics on the screen.

    Returns:    The maximum y screen coordinate.

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

    The following statements center the string on the screen and print
    it.

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

           int gdriver = DETECT;
           int gmode;

           main()
           {
               int maxx, maxy;
               int xcenter, ycenter, adjx;
               int len;
               char *tst = "This string is centered.";

               initgraph(&gdriver,&gmode,"");
               maxx = getmaxx();
               maxy = getmaxy();
               xcenter = maxx/2;
               ycenter = maxy/2;
               len = strlen(tst)*8;
               adjx = xcenter - len/2;
               outtextxy(adjx,ycenter,tst);
               getch();
               closegraph();
           }


See Also: getmaxx()

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