faint, 中文名真是怪异, 难道是 flood fill 算法?
图形颜色填充的一种算法.
图形颜色填充的一种算法.
解决方案 »
- java swing 怎么实现一个东东
- 求助:一个关于内部类的问题
- 欢迎到淘皮克计算机应用社区
- 结合Excel数据源的代码自动生成工具
- java swing界面设计问题
- 请问这条语句写的为什么不对?sql="select * from table1 where id not in (null,'')";
- 在线等关于“线程问题”,解决给分!!
- 请问。。。
- 今天真不走运,在win2000server下,我打开的IE窗口不知道为什么就被关闭了,有十几次了,我打开的不过十来个窗口,今天是第一次发现这个问题,请高人指点。
- java Oracle jjdbc 在eclipse中编写,无法成功连接Oracle
- jdbc问题!
- 如何把“Mon Jan 07 17:24:36 CST 2002”转换为SQL SERVER里DATETIME接受的格式?
扫描中有特别的洪水算法,相关的好象只有这个,如果需要,还有ip欺骗中的
flood算法,不会是那个吧?FloodFill 函数从给定的起始位置开始,以给定的颜色向四面八方填充某个区域(像水一样蔓延,因此叫 Flood Filling),一直到遇到与给定起始位置的象素值不同的点为止。因此,在这一过程中,我们需要两个回调函数,一个回调函数用来判断蔓延过程中遇到的点的象素值是否和起始点相同,另外一个回调函数用来生成填充该区域的水平扫描线。在进行绘图时,该函数比较的是象素值,但实际上,该函数也可以比较任何其他值,从而完成特有的蔓延动作。
功 能: 填充一个有界区域
用 法: void far floodfill(int x, int y, int border);
程序例: #include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h> int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int maxx, maxy; /* initialize graphics, local variables */
initgraph(&gdriver, &gmode, ""); /* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk)
/* an error occurred */
{
printf("Graphics error: %s\n",
grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
/* terminate with an error code */
} maxx = getmaxx();
maxy = getmaxy(); /* select drawing color */
setcolor(getmaxcolor()); /* select fill color */
setfillstyle(SOLID_FILL, getmaxcolor()); /* draw a border around the screen */
rectangle(0, 0, maxx, maxy); /* draw some circles */
circle(maxx / 3, maxy /2, 50);
circle(maxx / 2, 20, 100);
circle(maxx-20, maxy-50, 75);
circle(20, maxy-20, 25); /* wait for a key */
getch(); /* fill in bounded region */
floodfill(2, 2, getmaxcolor()); /* clean up */
getch();
closegraph();
return 0;
}