请输入您要查询的百科知识:

 

词条 detectgrap
释义

§ 解释

函数名: detectgraph

功 能: 通过检测硬件确定图形驱动程序和模式

用 法: void far detectgraph(int far *graphdriver, int far *graphmode);

§ 程序例

#include <graphics.h>

#include <stdlib.h>

#include <stdio.h>

#include <conio.h>

/* names of the various cards supported */

char *dname【】 = { "requests detection",

"a CGA",

"an MCGA",

"an EGA",

"a 64K EGA",

"a monochrome EGA",

"an IBM 8514",

"a Hercules monochrome",

"an AT&T 6300 PC",

"a VGA",

"an IBM 3270 PC"

};

int main(void)

{

/* returns detected hardware info. */

int gdriver, gmode, errorcode;

/* detect graphics hardware available */

detectgraph(&gdriver, &gmode);

/* read result of detectgraph call */

errorcode = graphresult();

if (errorcode != grOk) /* an error

occurred */

{

printf("Graphics error: %s\", \\

grapherrormsg(errorcode));

printf("Press any key to halt:");

getch();

exit(1); /* terminate with an error

code */

}

/* display the information detected */

clrscr();

printf("You have %s video display \\

card.\", dname【gdriver】);

printf("Press any key to halt:");

getch();

return 0;

}

随便看

 

百科全书收录594082条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/1/19 8:29:16