Friday, February 6, 2009

Simulation of Flood Fill Function In 'C'

The recursive function used is
void fld_fill1(int x,int y,int bclr,int fclr)
{
if(getpixel(x,y)==bclrgetpixel(x,y)==fclr)
return;
else
{
delay(1);
putpixel(x,y,fclr);
fld_fill1(x-1,y,bclr,fclr);
fld_fill1(x+1,y,bclr,fclr);
fld_fill1(x,y-1,bclr,fclr);
fld_fill1(x,y+1,bclr,fclr);
}
}

For Complete Code leave ur e-mail id and your college name below.

2 comments: