0
点赞
收藏
分享

微信扫一扫

126.设置填充类型和填充颜色

后来的六六 2022-05-04 阅读 108
/* set fill style */
#include <graphics.h>
void main()
{
	int i,c=4,x=5,y=6;
	int gdriver=DETECT,gmode;

	initgraph(&gdriver,&gmode,"c:\\tc");
	cleardevice();
	setcolor(c);
	for(i=c;i<c+8;i++)
	{
		setcolor(i);
		rectangle(x,y,x+140,y+104);
		x+=70;
		y+=52;
		setfillstyle(1,i);
		floodfill(x,y,i);
	}
	outtextxy(80,400,"Press any key to quit...");
	getch();
	closegraph();
}
举报

相关推荐

0 条评论