getmaxy function of c graphics

getmaxy function of c graphics programming is used to  get the maximum value of Y coordinate on graphic screen usually it is 479 for VGA driver and VGAHI graphic mode. getmaxx function is used to get the maximum value of X coordinate on graphic screen usually it is 639 for VGA driver and VGAHI graphics mode.

General syntax of getmaxy function is:
                                                 getmaxy();

                                         These function are very useful when we need to draw full screen rectanlge border for our drawing.

For Example:
                                                 rectangle( 0, 0, getmaxx(), getmaxy() );

C graphics program to demonstrate getmaxy function.

#include <graphics.h>
#include <stdio.h>

int main( )
{
    int gd=DETECT, gm;
    char msg[50];
    initgraph(&gd,&gm,"C:\\tc\\bgi");
    moveto(230,200);
    sprintf(msg,"Maximum value of X: %d",getmaxy());
    outtext(msg);

    getch();
    closegraph();

    return 0;
}


getmaxy function of c graphics

Download


0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.