C语言实现滚动字幕
2008-04-21 10:39
627 查看
#include <StdAfx.h>
#include <stdio.h>
#include <time.h>
#include <conio.h>
#include <string.h>
#define TIME_INTERVAL (CLOCKS_PER_SEC / 50)
int main(int argc, char* argv[])
...{
int i, j;
long c;
char str[80] = "Hello world!";
int l = strlen(str);
char sleft[80];
char sright[80];
int scrwidth = 79;
while (1)
...{
for (i = 0; i <= scrwidth; i++)
...{
if (i <= scrwidth - l)
...{
c = clock();
for (j = 0; j < i; j++)
...{
printf(" ");
}
printf("%s ", str);
while (clock() - c <= TIME_INTERVAL)
;
}
else
...{
c = clock();
strcpy(sleft, str);
strcpy(sright, str + l - (i - (scrwidth - l)));
*(sleft + l - (i - (scrwidth - l))) = NULL;
for (j = 0; j < i; j++)
...{
printf(" ");
}
printf("%s ", sleft);
printf("%s ", sright);
while (clock() - c <= TIME_INTERVAL)
;
}
}
}
return 0;
}
相关文章推荐
- css + js实现简单无缝滚动字幕
- ViewFlipper实现上下滚动字幕 三种方法实现
- 如何实现EDIUS中滚动字幕的制作
- .net C# 改变VS2005中屏保,实现字幕滚动和字体消隐技术
- 一个js实现简单的字幕滚动效果
- iOS实现滚动字幕的动画特效
- android TextView 垂直自动滚动字幕实现
- Android实现字幕滚动的方法
- c#之通过Timer控件实现字幕(label)滚动
- 使用JavaScript实现连续滚动字幕效果的方法
- cocos2dx用裁剪区域CCClippingNode实现滚动字幕
- android TextView 垂直自动滚动字幕实现
- 用javascript实现代替marquee的滚动字幕效果代码
- android TextView 垂直自动滚动字幕实现
- Android 滚动字幕实现
- Windows Mobile 滚动字幕的笨方法实现
- Html实现滚动字幕效果
- C# 滚动字幕的实现
- flex4之实现字幕滚动