Wednesday, December 4, 2013

TEXT ANIMATION WITH C

Hai friends in this program i am going to show you how to animate text using C,for this we have to use the header file , and this is also an illustration of using different fonts in our C program ,hope you will enjoy it  ,I am  compiled it with using TURBO C++ 3.0

#include
#include
#include
#include
#include
int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int style, midx, midy;
   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "");
   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk)  /* an error occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Use any TURBO C++ compailer \n,windows 7 users install dosbox or do in safe mode ");
      printf("Press any key to halt:");
      getch();
      exit(1); /* terminate with an error code */
   }
   midx = getmaxx() / 2;
   midy = getmaxy() / 2;
cleardevice();
        settextstyle(4,0,7);
        setbkcolor(2);
        setcolor(4); 
/* ANIMATING LOOP */
for(int k=0,p=0;(k
{
        delay(20);
        cleardevice();
outtextxy(k,p,"TRICKONICS.COM");
}
cleardevice();
        settextstyle(1,0,10);
setbkcolor(4);
        setcolor(2);
for(k,p;k>0,p>0;k--,p--)
       {outtextxy(p,k,"TRICKONICS");delay(20);
cleardevice();
}
cleardevice();  settextstyle(1,0,3);
outtextxy(midx-250,midy,"Thankyou visit our website www.trickonics.com"); 
         getch();
outtextxy(midx-250,midy+100,"devoloped by Muhammed roshan");
getch();
   /* clean up */
   closegraph();
   return 0;
}

No comments:

Post a Comment