最佳答案:
返回当前图形模式int far getgraphmode(void);
详情介绍
返回当前图形模式int far getgraphmode(void);

- 中文名
- getgraphmode
- 功 能
- 返回当前图形模式
- 用 法
- int far getgraphmode(void);
- 程序例
- #include
getgraphmode函数名
getgraphmode
getgraphmode功 能
返回当前图形模式
getgraphmode用 法
int far getgraphmode(void);
getgraphmode程序例
#include
#include
#include
#include
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int midx, midy, mode;
char numname, modename;
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %sn",

grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
mode = getgraphmode();
sprintf(numname,
"%d is the current mode number.",
mode);
sprintf(modename,
"%s is the current graphics mode",
getmodename(mode));
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(midx, midy, numname);
outtextxy(midx, midy+2*textheight("W"),
modename);

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


