FLOOD FILL PROGRAM IN C
FLOOD FILL PROGRAM IN C
Similar Programs
- Triangle Rotation Program
- Text animation program in C
- C program for fixed point scaling and rotation
- C Program for shearing of triangle, line and rectangle
- C program to plot different types of lines
- Scaling program in C
- Font animation program in C
- Midpoint ellipse drawing program in C
- Circle Midpoint program in C
- Translation program in C
- Bresenhem Circle drawing program in C
- String Generation program in C
- Bresenhem Line drawing program in C
- Plotting a pixel in C
- DDA line drawing program in C
- Boundary fill program in C
- Character Generation program in C
- Triangle Rotation program in C
//***PROGRAM FOR FLOOD FILL ALGORITHM***//
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void flodfill(int x,int y,int f,int o)
{
int c;
c=getpixel(x,y);
if(c==o)
{
setcolor(f);
putpixel (x,y,f);
delay(10);
flodfill(x+1,y,f,o);
flodfill(x,y+1,f,o);
flodfill(x+1,y+1,f,o);
flodfill(x-1,y-1,f,o);
flodfill(x-1,y,f,o);
flodfill(x,y-1,f,o);
flodfill(x-1,y+1,f,o);
flodfill(x+1,y-1,f,o);
}
}
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\tc\bgi");
rectangle(50,50,100,100);
flodfill(51,51,4,0);
getch();
}
Correct Progs in Working conditon
awesome
thanku…
thank u