#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<string.h>
#define pixTOrc(x) (8*(x-1)) //convert pixel into row and col format//Displays Graphic text in delaying fashionvoid displayMe(int x,int y,constchar *ch,int delayTime){
char d[2];
int len=strlen(ch);
for(int i=0;i<=len;i++)
{
d[0]=ch[i];
d[1]='\0';
outtextxy(x+pixTOrc((i+1)*2),y,d);
delay(delayTime);
}
}
//At Exit the end function will call...void end(){
int i,j;
settextstyle(SMALL_FONT,HORIZ_DIR,7);
displayMe(pixTOrc(5),pixTOrc(18),"www.syntax-example.com",250);
displayMe(pixTOrc(5.25),pixTOrc(18),"www.syntax-example.com",80);
setcolor(LIGHTGREEN);
displayMe(pixTOrc(5),pixTOrc(23),"www.syntax-example.com",250);
displayMe(pixTOrc(5.25),pixTOrc(23),"www.syntax-example.com",80);
setcolor(LIGHTCYAN);
displayMe(pixTOrc(5),pixTOrc(28),"www.syntax-example.com",250);
displayMe(pixTOrc(5.25),pixTOrc(28),"www.syntax-example.com",80);
setcolor(LIGHTMAGENTA);
outtextxy(pixTOrc(5),pixTOrc(45),"Your Suggestion and comments are always welcome");
delay(2000);
}
void main()
{
int i,j;
int gd=DETECT,gm=0;
initgraph(&gd,&gm,"");
////Code as space holder\\\\\\
setfillstyle(SOLID_FILL,BLACK);
bar(0,0,640,480);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
setcolor(BLUE);
outtextxy(pixTOrc(8),pixTOrc(2)," Text Animation");
setfillstyle(LINE_FILL,DARKGRAY);
for(i=15,j=70;i<40||j>40;i++,j--){
bar(pixTOrc(8),pixTOrc(7),pixTOrc(i),pixTOrc(7.5));
delay(10);
bar(pixTOrc(j),pixTOrc(7),pixTOrc(70),pixTOrc(7.5));
delay(20);
}
setcolor(YELLOW);
////Code as space holder\\\\\\//calling of Text animation
end();
closegraph();
}