复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99//EasyX入门和介绍 //画实心圆 #include <graphics.h> //引用EasyX图形库 #include <conio.h> int main() { initgraph(640,480); //初始画布 setcolor(YELLOW); //圆的线条为黄色 setfillcolor(GREEN); //填充色为绿色 fillcircle(100,100,20); //圆心(100,100),半径为20 closegraph(); //关闭图形界面 return 0; } //画十条平行线 #include <graphics.h> //引用EasyX图形库 #include <conio.h> int main() { initgraph(640,480); //初始画布 for(int y=0;y<=480;y=y+48) { line(0,y,640,y); } getch; closegraph(); //关闭图形界面 return 0; } //红蓝交替画线 #include <graphics.h> //引用EasyX图形库 #include <conio.h> int main() { initgraph(640,480); //初始画布 for(int y=0;y<=200;y=y+5) { if(y/5%2==1) setcolor(RGB(255,0,0)); else setcolor(RGB(0,0,255)); line(0,y,640,y); } getch(); closegraph(); //关闭图形界面 return 0; } //绘制围棋棋盘 #include <graphics.h> //引用EasyX图形库 #include <conio.h> int main() { initgraph(640,480); //初始画布 int step=30; closegraph(); //关闭图形界面 setbkcolor(YELLOW); cleardevice; setlinestyle(PS_SOLID,2); setcolor(RGB(0,0,0)); int i; for(i=1,i<=19;i++) { line(i*step,1*step,i*step,19*step); line(1*step,i*step,19*step,i*step); } getch(); closegraph(); return 0; } //绘制国际象棋 #include <graphics.h> //引用EasyX图形库 #include <conio.h> int main() { initgraph(500,500); //初始画布 int step=50; closegraph(); //关闭图形界面 setbkcolor(YELLOW); //设置背景色为黄色 cleardevice; //用背景色清空屏幕 int i,j; for(i=1;i<=8;i++) { for(j=1;j<=8;j++) { if((i+j)%2==1) { setfillcolor(BLACK); solidrectangle(i*step,j*step,(i+1)*step,(j+1)*step); //绘制黑色砖块 } else { setfillcolor(WHITE); solidrectangle(i*step,j*step,(i+1)*step,(j+1)*step); //绘制白色砖块 } } } getch(); closegraph(); return 0; }
最后
以上就是舒服未来最近收集整理的关于EasyX入门和介绍的全部内容,更多相关EasyX入门和介绍内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复