標籤: 暫無標籤

 

1 getmaxcolor -函數功能

函數名: getmaxcolor
功 能: 返回可以傳給函數setcolor的最大顏色值
用 法: int far getmaxcolor(void);

2 getmaxcolor -程序示例

#include
#include
#include
#include

int main(void)
{
"
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
char colstr[80];

" initgraph(&gdriver, &gmode, "");

"
errorcode = graphresult();
if (errorcode != grOk) "
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); "
}

midx = getmaxx() / 2;
midy = getmaxy() / 2;

"
sprintf(colstr, "This mode supports colors 0..%d", getmaxcolor());

"
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(midx, midy, colstr);

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

上一篇[埃文斯頓]    下一篇 [getmaxy]

相關評論

同義詞:暫無同義詞