淮阴工学院计算科学系.docVIP

  • 1
  • 0
  • 约2.64千字
  • 约 7页
  • 2019-03-28 发布于江苏
  • 举报
淮阴工学院计算机科学系 实验报告书 课程名: 《图形学与数字图像处理》 题 目: 实验5 个性化图形软件包的开发 班 级: 学 号: 姓 名: 评语: 评语: 成绩: 指导教师: 批阅时间: 年 月 日 1、实验目的 通过实验,综合运用计算机图形学的知识、原理和算法; 掌握图形软件包的开发过程; 通过编程,会在TC环境下编程实现个性化图形软件包的开发。 2、实验环境 计算机、Turbo C或其他C语言程序设计环境 3、实验内容 本实验利用C语言提供的通用软件包,结合图形学中图形绘制流程,综合各图形处理的算法(在此不再祥述),编写程序实现个性化图形软件包的制作。 4、实验步骤与源程序 = 1 \* GB2 ⑴ 实验步骤 新建两个文本文档,分别取名为c.h、bingxing.h,并在里面写入相应代码; 将c.h、bingxing.h放在include包中; 写个main方法调用一下并且保存为main.c; 具体代码和截图如下所示; = 2 \* GB2 ⑵ 源代码 1c.h #include graphics.h #includemath.h #define PI 3.1415926 c() { int x1,y1,x2,px=320,py=240; double a; int gdriver=DETECT,gmode; initgraph(gdriver,gmode,c:\\tc); cleardevice(); setbkcolor(9); setcolor(4); for(a=0;a=PI;a+=PI/380) { x1=280*cos(1.6*a)+px; y1=478-((90*sin(8*a)) *cos(a/2.5)+py); x2=280*cos(1.8*a)+px; line(x1,y1,x2,y1); } getch(); closegraph(); } 2?bingxing.h #includestdio.h #includegraphics.h #includemath.h bingxing() { int driver=DETECT,mode; initgraph(driver,mode,C:\\tc); cleardevice(); setbkcolor(0); setcolor(4); setlinestyle(0,0,3); circle(200,200,100); setlinestyle(0,0,3); line(200,200,200,100); line(130,270,200,200); line(270,270,200,200); line(100,200,200,200); setfillstyle(1,5); floodfill(210,190,4); setfillstyle(1,BLUE); floodfill(190,190,4); setfillstyle(1,YELLOW); floodfill(170,210,4); setfillstyle(1,GREEN); floodfill(200,220,4); setcolor(12); line(350,100,550,100); line(550,100,550,300); line(550,300,350,300); line(350,300,350,100); bar(362,112,412,137); setfillstyle(1,5); bar(362,162,412,187); setfillstyle(1,BLUE); bar(362,212,412,237); setfillstyle(1,YELLOW); ba

文档评论(0)

1亿VIP精品文档

相关文档