getmaxcolor,
函数名,返回可以传给函数
setcolor的最大颜色值。
定义
用 法: int far getmaxcolor(void);
示例
程序例:
程序例
#include
#include
#include
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
char colstr[80];
/* initialize graphics and local variables
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
getch();
exit(1); /* terminate with an error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
/* grab the color info. and convert it to a string */
/* display the information */
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(midx, midy, colstr);
/* clean up */
getch();
closegraph();
return 0;
}