faint, 中文名真是怪异, 难道是 flood fill 算法?
图形颜色填充的一种算法.

解决方案 »

  1.   

    很抱歉,你的要求好象太大了,我可没那么大的本事:)说实话,没听说在游戏
    扫描中有特别的洪水算法,相关的好象只有这个,如果需要,还有ip欺骗中的
    flood算法,不会是那个吧?FloodFill 函数从给定的起始位置开始,以给定的颜色向四面八方填充某个区域(像水一样蔓延,因此叫 Flood Filling),一直到遇到与给定起始位置的象素值不同的点为止。因此,在这一过程中,我们需要两个回调函数,一个回调函数用来判断蔓延过程中遇到的点的象素值是否和起始点相同,另外一个回调函数用来生成填充该区域的水平扫描线。在进行绘图时,该函数比较的是象素值,但实际上,该函数也可以比较任何其他值,从而完成特有的蔓延动作。
      

  2.   

    这个是c语言的类库函数,仅做参考,不能完成特有的比较行为,想实现特有的比较行为,肯定要自己编:函数名: floodfill 
    功 能: 填充一个有界区域 
    用 法: 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;