Loading..: Using C and graphics

Hey guys, today I am posting a simple program which illustrate loading any videos or files. You might have seen this in while watching videos online. Well, here's the screen shot of the output.


Let us see the codes now, hope you guys like it..

/*
    Programmer: Ashok Kumar Shrestha (ak007)
    Program Details: Generates Circular pattern2.1  for loading
*/


#include<graphics.h>
#include<conio.h>
#include<dos.h>

main()
{
   int gd = DETECT, gm, x, y, color, angle = 0;
   struct arccoordstype a, b;

   initgraph(&gd, &gm, "..\\BGI");
   delay(200);

   setcolor(11);
   settextstyle(1,0,4);
   outtextxy(260,380,"Loading...");

   while(!kbhit())
   {
      setcolor(BLACK);
      arc(getmaxx()/2,getmaxy()/2,angle,angle+2,100);
      setcolor(8);
      getarccoords(&a);
      setfillstyle(SOLID_FILL,8);
      circle(a.xstart,a.ystart,15);
      floodfill(a.xstart,a.ystart,8);

      setcolor(BLACK);
      arc(getmaxx()/2,getmaxy()/2,(angle+30)%360,(angle+30)%360+2,100);
      setcolor(8);
      getarccoords(&a);
      setfillstyle(SOLID_FILL,7);
      circle(a.xstart,a.ystart,15);
      floodfill(a.xstart,a.ystart,8);

      setcolor(BLACK);
      arc(getmaxx()/2,getmaxy()/2,(angle+60)%360,(angle+60)%360+2,100);
      setcolor(7);
      getarccoords(&a);
      setfillstyle(SOLID_FILL,7);
      circle(a.xstart,a.ystart,15);
      floodfill(a.xstart,a.ystart,7);

      setcolor(BLACK);
      arc(getmaxx()/2,getmaxy()/2,(angle+90)%360,(angle+90)%360+2,100);
      setcolor(15);
      getarccoords(&a);
      setfillstyle(SOLID_FILL,15);
      circle(a.xstart,a.ystart,15);
      floodfill(a.xstart,a.ystart,15);


      angle = angle+30;
      delay(100);
      if(angle==360)
      {
          angle=0;
      }
   }

   getch();
   closegraph();
   return 0;
}
//End of the program

Comments

  1. Hey guy ! What is the work of structure & getarccord(&a)?? Please ! Explain it ! thanku !

    ReplyDelete

Post a Comment

Popular posts from this blog

mTranslator

Circular Pattern Using C/C++ and Graphics

Sorting Hat: Privacy Policy