getmaxx function of c graphics

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

General syntax of getmaxx function is:
                                                 getmaxx();

                                         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 getmaxx 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",getmaxx());
    outtext(msg);

    getch();
    closegraph();

    return 0;
}


getmaxx function of c graphics

Download


0 comments:

Post a Comment