Q:

getmaxcolor function using graphics.h

0

getmaxcolor function using graphics.h

getmaxcolor function returns maximum color value for current graphics mode and driver. Total number of colors available for current graphics mode and driver are ( getmaxcolor() + 1 ) as color numbering starts from zero.

Declaration: int getmaxcolor();

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

main()
{
   int gd = DETECT, gm, max_colors;
   char a[100];

   initgraph(&gd,&gm,"C:\\TC\\BGI");
   
   max_colors = getmaxcolor();

   sprintf(a,"Maximum number of colors for current graphics mode and driver = %d",max_colors+1);
   outtextxy(0, 40, a);

   getch();
   closegraph();
   return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now