标题:C++文字移动
只看楼主
RobinWang
Rank: 3Rank: 3
来 自:北京
等 级:论坛游侠
帖 子:69
专家分:121
注 册:2013-5-31
结帖率:50%
已结贴  问题点数:15 回复次数:4 
C++文字移动
#include <graphics.h>
#include <conio.h>
void myouttextxy(int x, int y, LPCTSTR s)
{
static IMAGE tmp;
if (s == NULL)
{
putimage(x, y, &tmp);
}
else
{
int w = textwidth(s);
int h = textheight(s);
getimage(&tmp, x, y, w, h);
outtextxy(x, y, s);
}
}
void main()
{
TCHAR s[] = _T("祝大家梦想成真;祝Robin万寿无疆.");
initgraph(640, 480);
int w = textwidth(s);   
int h = textheight(s);   
IMAGE tmp;   
for(int i = 0; i < 640; i++)
{
setlinecolor( HSLtoRGB((float)i, 1.0, 0.25) );
line(i, 0, i, 479);
}
setlinecolor(RED);   
setbkmode(TRANSPARENT);   
for(int j = 0; j < 600; j++)
{
myouttextxy(j, 100, s);
Sleep(20);
myouttextxy(j, 100, NULL);
}
_getch();
closegraph();
}
搜索更多相关主题的帖子: include 
2013-05-31 11:20
yuccn
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:何方
等 级:版主
威 望:167
帖 子:6809
专家分:42393
注 册:2010-12-16
得分:5 
祝大家梦想成真;祝Robin万寿无疆

我行我乐
我的博客:
http://blog.yuccn. net
2013-05-31 12:37
邓士林
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
来 自:淮河河畔
等 级:贵宾
威 望:61
帖 子:2391
专家分:13384
注 册:2013-3-3
得分:5 
#include <graphics.h>看到这个头都大

Maybe
2013-05-31 14:15
新手坑
Rank: 2
等 级:论坛游民
帖 子:6
专家分:12
注 册:2013-5-30
得分:5 
.......#include <graphics.h>。。楼主用的是vc?
2013-06-01 18:55
RobinWang
Rank: 3Rank: 3
来 自:北京
等 级:论坛游侠
帖 子:69
专家分:121
注 册:2013-5-31
得分:0 
回复 4楼 新手坑
VC的绘图

将压抑的青春能量转化为改造中国的动力!
2013-06-03 21:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-412660-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.172325 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved