给你发一个剽窃程序,还不错。
var{定义变量}
Form1:TForm1;
x,tt,l,h:integer;
pic:Trect;
map:Tbitmap;{具体动画演示代码}
procedureTForm1.Timer1Timer(Sender:TObject);
begin
x:=x-1;
tt:=tt-1;
if x<-160 then
x:=image1.height+20;
tt:=x+80;
image1.Canvas.font.size:=18;
image1.Canvas.font.color:=$1200ffff;
image1.Canvas.TextOut(10,x,’OK字幕移动演示’);
image1.Canvas.font.size:=12;
image1.Canvas.font.color:=$120000ff;
image1.Canvas.TextOut(20,x+50,’字体变色效果演示’);
l:=image1.Canvas.textwidth(’字体变色效果演示’);
h:=image1.Canvas.textheight(’字体变色效果演示’);
image1.Canvas.pen.color:=clGreen;
image1.Canvas.moveto(20,h+x+50-2);
image1.Canvas.lineto(20+l,h+x+50-2);
pic.topleft.x:=30;
pic.topleft.y:=tt;
pic.bottomright.x:=pic.topleft.x+100;
pic.bottomright.y:=pic.topleft.y+80;
image1.canvas.stretchdraw(pic,map);
image1.Canvas.pen.color:=clGreen;
image1.Canvas.moveto(0,pic.topleft.y+80);
image1.Canvas.lineto(pic.topleft.x+100,pic.topleft.y+80);
end;
{以下设置动画初值}
procedureTForm1.FormCreate(Sender:TObject);
begin
timer1.enabled:=true;
timer1.Interval:=10;
x:=image1.height+20;
tt:=x+80;
form1.repaint;
image1.Canvas.brush.color:=clGreen;
pic:=Rect(0,0,image1.width,image1.height);
image1.Canvas.FillRect(pic);
pic:=Rect(-1,-1,1,1);
map:=Tbitmap.create;
map.loadfromfile(’d:windows256color.bmp’);
image1.canvas.stretchdraw(pic,map);
end;