getmaxcolor function using graphics.h

  • برمجة سي c

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();

الأجوبة

#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;
}
هل كان المحتوى مفيد؟

القوائم الدراسية التي ينتمي لها السؤال

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...