int driver;
driver=DETECT;
mode=0;
initgraph(&driver,&mode,"");
这些在画圆的程序中起什么作用啊?
这些语句在tc画圆中的意义
答案:1 悬赏:30 手机版
解决时间 2021-04-09 17:53
- 提问者网友:我是女神我骄傲
- 2021-04-08 21:56
最佳答案
- 五星知识达人网友:酒安江南
- 2021-04-08 22:23
Turbo C(TC)语言库函数:initgraph 所属文件: <graphics.h>函数
函数原型: void far initgraph(int far *graphdriver, int far *graphmode, char far *pathtodriver)
函数功能: 初始化图形系统
函数返回: 以下代码将图形系统初始化为VGA 640x480 16色工作方式:
int driver=VGA,mode=VGAHI;
initgraph(&driver,&mode,"c:\tc")
函数说明: graphdriver 图形驱动器代号,具体如下:
DETECT 0 CGA 1 MCGA 2 EGA 3 EGA64 4
EGAMONO 5 IBM8514 6 HERCMONO 7 ATT400 8 VGA 9
PC3270 10
graphmode 选定图形驱动器的工作模式,具体如下:
CGAC0= 0 320x200 palette 0 1 page
CGAC1= 1 320x200 palette 1 1 page
CGAC2= 2 320x200 palette 2 1 page
CGAC3= 3 320x200 palette 3 1 page
CGAHI= 4 640x200 1 page
MCGAC0= 0 320x200 palette 0 1 page
MCGAC1= 1 320x200 palette 1 1 page
MCGAC2= 2 320x200 palette 2 1 page
MCGAC3= 3 320x200 palette 3 1 page
MCGAMED= 4 640x200 1 page
MCGAHI= 5 640x480 1 page
EGALO= 0 640x200 16 color 4 pages
EGAHI= 1 640x350 16 color 2 pages
EGA64LO= 0 640x200 16 color 1 page
EGA64HI= 1 640x350 4 color 1 page
EGAMONOHI= 0 640x350 64K on card 1 page
256K on card 4 pages
HERCMONOHI = 0 720x348 2 pages
ATT400C0= 0 320x200 palette 0 1 page
ATT400C1= 1 320x200 palette 1 1 page
ATT400C2= 2 320x200 palette 2 1 page
ATT400C3= 3 320x200 palette 3 1 page
ATT400MED= 4 640x200 1 page
ATT400HI= 5 640x400 1 page
VGALO= 0 640x200 16 color 4 pages
VGAMED= 1 640x350 16 color 2 pages
VGAHI= 2 640x480 16 color 1 page
PC3270HI= 0 720x350 1 page
IBM8514LO = 0 640x480 256 colors
IBM8514HI = 1 1024x768 256 colors
pathtodriver 图形驱动器文件路径,如不修改,图形驱动器文件在TC目录下
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode,"");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error:%s
", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
line(0, 0, getmaxx(), getmaxy());
getch();
closegraph();
return 0;
}
函数原型: void far initgraph(int far *graphdriver, int far *graphmode, char far *pathtodriver)
函数功能: 初始化图形系统
函数返回: 以下代码将图形系统初始化为VGA 640x480 16色工作方式:
int driver=VGA,mode=VGAHI;
initgraph(&driver,&mode,"c:\tc")
函数说明: graphdriver 图形驱动器代号,具体如下:
DETECT 0 CGA 1 MCGA 2 EGA 3 EGA64 4
EGAMONO 5 IBM8514 6 HERCMONO 7 ATT400 8 VGA 9
PC3270 10
graphmode 选定图形驱动器的工作模式,具体如下:
CGAC0= 0 320x200 palette 0 1 page
CGAC1= 1 320x200 palette 1 1 page
CGAC2= 2 320x200 palette 2 1 page
CGAC3= 3 320x200 palette 3 1 page
CGAHI= 4 640x200 1 page
MCGAC0= 0 320x200 palette 0 1 page
MCGAC1= 1 320x200 palette 1 1 page
MCGAC2= 2 320x200 palette 2 1 page
MCGAC3= 3 320x200 palette 3 1 page
MCGAMED= 4 640x200 1 page
MCGAHI= 5 640x480 1 page
EGALO= 0 640x200 16 color 4 pages
EGAHI= 1 640x350 16 color 2 pages
EGA64LO= 0 640x200 16 color 1 page
EGA64HI= 1 640x350 4 color 1 page
EGAMONOHI= 0 640x350 64K on card 1 page
256K on card 4 pages
HERCMONOHI = 0 720x348 2 pages
ATT400C0= 0 320x200 palette 0 1 page
ATT400C1= 1 320x200 palette 1 1 page
ATT400C2= 2 320x200 palette 2 1 page
ATT400C3= 3 320x200 palette 3 1 page
ATT400MED= 4 640x200 1 page
ATT400HI= 5 640x400 1 page
VGALO= 0 640x200 16 color 4 pages
VGAMED= 1 640x350 16 color 2 pages
VGAHI= 2 640x480 16 color 1 page
PC3270HI= 0 720x350 1 page
IBM8514LO = 0 640x480 256 colors
IBM8514HI = 1 1024x768 256 colors
pathtodriver 图形驱动器文件路径,如不修改,图形驱动器文件在TC目录下
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode,"");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error:%s
", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
line(0, 0, getmaxx(), getmaxy());
getch();
closegraph();
return 0;
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯