动态函数图像演示-C语言课程设计实验报告(含源码)

发布时间 : 星期六 文章动态函数图像演示-C语言课程设计实验报告(含源码)更新完毕开始阅读

eaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif C语言课程设计实验报告 题 目:动态函数图像演示 学 院:软件学院 指 导 老 师: 学 号: 姓 名: 2012年9月3号—9月17日 iculties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatteaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif 一、实验题目及要求 画出函数y=a*x^2+b*x+c 的曲线图形 (1)设置对话框确定函数参数 (2)设置对话框确定曲线的粗细 (3)设置对话框确定曲线的颜色 (4)画出一个小人沿着曲线轨迹移动,并画出曲线图形 (5)将画出的图形保存为jpg格式,并要求可以用其他看图软件打开 二、程序主要流程 (1)建立首界面(即为进入或退出画图软件) (2)设定对话框依次确定函数参数,曲线粗细,曲线颜色 iculties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatteaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif (3)初始化画图系统画出坐标系与曲线 (4)建立动态画图函数 (5)建立保存与打开图形的函数 三、在程序中遇到的困难及解决方案 在构建首界面时运用了通过读取键盘值来控制光标的移动达到进入或退出看图软件。在使用键盘值时, 由老师给出的资料可以得知为键盘头文件,bioskey(1)==0为读取键盘值,并且得到了 key_up 72 key_esc 1 Key_enter 28 key_down 80为获取到的键盘值。 例: int get_key() /*设定键盘控制*/ { union REGS rg; rg.h.ah=0; int86(0x16,&rg,&rg); return rg.h.ah; getchar(); } 在设置第一个对话框时,从TC-2.0函数软件查询中搜查到了 window为建立字符模式下的矩形字符窗口, textbackground为设置字符模式下的背景颜色,textcolor为设置字符模式下的字符颜色,由此解决了在

3

iculties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatteaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif 字符模式下对话框背景及字符的颜色设置,gotoxy为将当前字符屏幕的光标位置移动到x,y坐标位置, gettext为保存矩形屏幕上的字符,puttext为将gettext函数保存的字符恢复到屏幕上,由此解决了在合 适的位置上输入字符的问题。上述函数名均在头文件中。画图像时由老师给出的资料了中解到 gdriver = DETECT;registerbgidriver(EGAVGA_driver);initgraph(&gdriver, &gmode,\为注册已连接 的图形驱动器程序和初始化图形系统,并且其头文件为。画曲线时,主要思路为通过画出一 个个点来组成曲线图形,用到的函数名称为circle(画圆圈)。设置动态图画时用到了 头文件以及 函数名delay。在编写保存和打开图像时遇到了困难,通过询问老师和上网查资料找到了解决办法。 例: void save() /*储存图形函数*/ { int i,j; /*i,j代表像素所在坐标*/ FILE *fp; /*声明一个文件地址*/ char fileName[20]; /*filename代表文件名被储存的所在数组*/ window(1,1,80,80); gotoxy(1,1); /*将当前字符屏幕的光标位置移动到(1,1)坐标*/ printf(\输入要被保存图像所在的文件名并储存*/ scanf(\ window(1,1,80,80); if((fp=fopen(fileName,\以读写的方式打开文件*/ { outtextxy(260,455,\图形模式下在x,y坐标位置显示一行字符串*/ exit(0); } outtextxy(500,455,\ for(i=5;i<630;i++) /*保存像素到文件*/ for(j=30;j<=445;j++) fputc(getpixel(i,j),fp); fclose(fp); window(1,1,80,80); outtextxy(500,455,\ } iculties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatt

联系合同范文客服:xxxxx#qq.com(#替换为@)