getmaxcolor

Overview :

The "getmaxcolor" function is used to get the highest valid color that is supported by the graphics system.

Syntax :
int getmaxcolor();
Description :

The "getmaxcolor" function has no parameters

  • The function can be called in grahics mode.

  • The function return integer value



Example :
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main()
{
    
   int gm,gd=DETECT,maxcolor;
   
   initgraph(&gd,&gm,"C:\\turboc3\\bgi");
   setcolor(10);
   
   maxcolor = getmaxcolor();
   
   printf("\nThe maximun color value is %d",maxcolor);
   
   getch();
   closegraph();
   return 0;
}

Comments

comments powered by Disqus