const ShowLength = 10; //一行显示的字符数目 全局变量str_posonTimer: begin inc(str_pos); if str_pos > Length(yourStr)-ShowLength then str_pos:=1; Edit1.Text := copy(yourStr,str_pos,ShowLength); end;这个函数没有经过测试
借鉴于Borland的VCLScanner,image中事先设定好你的图片. DelphiBanner:TImage; BCBBanner: TImage; BannerTimer: TTimer; LinuxBanner: TImage; type TBannerInFront = (bDelphi, bBCB, bLinux);var BannerInFront: TBannerInFront = bDelphi;procedure TfrmMain.BannerTimerTimer(Sender: TObject); begin case BannerInFront of bDelphi: begin DelphiBanner.Hide; BCBBanner.Show; BannerInFront := bBCB; end; bBCB: begin BCBBanner.Hide; LinuxBanner.Show; BannerInFront := bLinux; end; bLinux: begin LinuxBanner.Hide; DelphiBanner.Show; BannerInFront := bDelphi; end; end; end;
pnlAbout: TPanel; procedure TFAbout.Timer1Timer(Sender: TObject); begin if pnlAbout.Top>-pnlAbout.Height then pnlabout.Top:=pnlAbout.Top-1 else pnlAbout.Top:=fAbout.Height-9; end; 这个是上下滚动
全局变量str_posonTimer:
begin
inc(str_pos);
if str_pos > Length(yourStr)-ShowLength then str_pos:=1;
Edit1.Text := copy(yourStr,str_pos,ShowLength);
end;这个函数没有经过测试
DelphiBanner:TImage;
BCBBanner: TImage;
BannerTimer: TTimer;
LinuxBanner: TImage;
type
TBannerInFront = (bDelphi, bBCB, bLinux);var
BannerInFront: TBannerInFront = bDelphi;procedure TfrmMain.BannerTimerTimer(Sender: TObject);
begin
case BannerInFront of
bDelphi:
begin
DelphiBanner.Hide;
BCBBanner.Show;
BannerInFront := bBCB;
end;
bBCB:
begin
BCBBanner.Hide;
LinuxBanner.Show;
BannerInFront := bLinux;
end;
bLinux:
begin
LinuxBanner.Hide;
DelphiBanner.Show;
BannerInFront := bDelphi;
end;
end;
end;
procedure TFAbout.Timer1Timer(Sender: TObject);
begin
if pnlAbout.Top>-pnlAbout.Height then
pnlabout.Top:=pnlAbout.Top-1
else
pnlAbout.Top:=fAbout.Height-9;
end;
这个是上下滚动
用timer控制image.canvas.textout()不断重画就可以实现文本的水平滚动动画