使用绘图库函数画circle图形


此篇文章主要应用了函数库中的基本函数(COLORREF、circle)进行作图。


#include “graphics.h” // 就是需要引用这个图形库
#include <conio.h>
void main()
{
initgraph(600, 400); // 这里和 TC 略有区别

COLORREF color = RGB(255, 255, 255);

	for (int i = 0; i < 30; i++)
	{
		color = RGB(i * 8, 255, 255);
		setcolor(color);
		circle(10 * i, 200, i * 3);// 画圆,圆心(200, 200),半径 100
	}
	 
	system("pause");   // 按任意键继续
	closegraph();    // 关闭图形界面
}

注:这里使用的 #include “graphics.h” 在相应的工程文件中需要加上插件:
在这里插入图片描述
具体可以在百度上下载此插件。

猜你喜欢

转载自blog.csdn.net/weixin_43718414/article/details/84147064