我做了一个有你所说的那样 8-)
在窗体中放入Image Timer 这两个控件 在加入以下代码就可以了
呵呵 8-) 很简单吧!Image控件要你自己去调节它的长短哦!
作者:qbtxx
多少我想你也要给点分吧!!! 呵呵
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
x,tt:integer;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
x:=x-1;
tt:=tt-1;
if x<-176 then
x:=image1.height+10;
tt:=x+10;
image1.Canvas.font.size:=16;
image1.Canvas.Font.Style:=[fsItalic];
image1.Canvas.Font.Color:=$00c080ff;
image1.Canvas.TextOut(10,x,'你');
image1.Canvas.Font.Color:=$00ff0080;
image1.Canvas.TextOut(10,x+20,'好');
image1.Canvas.Font.Color:=$00408080;
image1.Canvas.TextOut(10,x+40,'呀');
image1.Canvas.Font.Color:=$008080ff;
image1.Canvas.TextOut(10,x+60,'可');
image1.Canvas.Font.Color:=$00408000;
image1.Canvas.TextOut(10,x+80,'爱');
image1.Canvas.Font.Color:=$00400080;
image1.Canvas.TextOut(10,x+100,'的');
image1.Canvas.Font.Color:=$004080ff;
image1.Canvas.TextOut(10,x+120,'妹');
image1.Canvas.Font.Color:=$00c08000;
image1.Canvas.TextOut(10,x+140,'妹');
image1.Canvas.Font.Color:=ClPurple;
image1.Canvas.TextOut(10,x+160,'!');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
timer1.enabled:=true;
timer1.Interval:=10;
x:=image1.height+10;
tt:=x+10;
end;
end.