void flood_fill(int x,int y,int fc,int bc)
{
int color=getpixel(x,y);
if(color==bc)
{
putpixel(x,y,12);
flood_fill(x,y+1,fc,bc);
flood_fill(x+1,y,fc,bc);
flood_fill(x,y-1,fc,bc);
flood_fill(x-1,y,fc,bc);
}
}
{
int color=getpixel(x,y);
if(color==bc)
{
putpixel(x,y,12);
flood_fill(x,y+1,fc,bc);
flood_fill(x+1,y,fc,bc);
flood_fill(x,y-1,fc,bc);
flood_fill(x-1,y,fc,bc);
}
}
No comments:
Post a Comment