| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 882 人关注过本帖
标题:关于floodfill填充问题
只看楼主 加入收藏
cordier
Rank: 2
等 级:论坛游民
威 望:1
帖 子:449
专家分:14
注 册:2006-2-9
结帖率:60%
收藏
 问题点数:0 回复次数:2 
关于floodfill填充问题

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int i,j,per=20;
int m=4,n=3;
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s\n",grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
setcolor(5);
rectangle(0,0,n*per,m*per);
for (i=1;i<m;i++)
line(0,i*per,n*per,i*per);
for (i=1;i<n;i++)
line(i*per,0,i*per,m*per);
getch();
for (i=0;i<m;i++)
for (j=0;j<n;j++)
floodfill(j*per+0.5*per,i*per+0.5*per,getmaxcolor());
getch();
closegraph();
}


我的目的是:每一个小格中以白色填充。

搜索更多相关主题的帖子: floodfill 
2006-03-22 08:19
feng1256
Rank: 4
等 级:贵宾
威 望:14
帖 子:2899
专家分:0
注 册:2005-11-24
收藏
得分:0 
你没有设置 setfillstyle()
而且floodfill()中最后一个参数是边界颜色,不是填充颜色

叁蓙大山:工謪、稅務、嗣發 抱歉:不回答女人的问题
2006-03-22 16:23
cordier
Rank: 2
等 级:论坛游民
威 望:1
帖 子:449
专家分:14
注 册:2006-2-9
收藏
得分:0 

击中要害。
谢谢。


2006-03-23 08:56
快速回复:关于floodfill填充问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018277 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved