getmaxcolor function of c graphics

getmaxcolor function of c graphics is used to get the maximum number of color in graphics mode. getcolor function is used to get the current foreground color in graphic mode.

General syntax of getmaxcolor function is :
                                                     getmaxcolor();

C graphics program to demonstrate the getmaxcolor 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 number of color: %d",getmaxcolor());
    outtext(msg);

    getch();
    closegraph();

    return 0;
}



getmaxcolor function of c graphics programming

Download


1 comments: