Write a Program to draw animation using increasing circles filled with different colors and patterns.

 

Write a Program to draw animation using increasing circles filled with different colors and patterns.


  1. #include<graphics.h>  
  2. #include<conio.h>  
  3. void main()  
  4. {  
  5.     intgd=DETECT, gm, i, x, y;  
  6.     initgraph(&gd, &gm, "C:\\TC\\BGI");  
  7.     x=getmaxx()/3;  
  8.     y=getmaxx()/3;  
  9.     setbkcolor(WHITE);  
  10.     setcolor(BLUE);  
  11.     for(i=1;i<=8;i++)  
  12.           {  
  13.         setfillstyle(i,i);  
  14.         delay(20);  
  15.         circle(x, y, i*20);  
  16.         floodfill(x-2+i*20,y,BLUE);  
  17.     }  
  18.     getch();  
  19.     closegraph();  
  20. }  

Output

Computer Graphics Programs

Post a Comment

Previous Post Next Post