我编了一个小程序实现你要的功能。很简单,
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls;
type
TForm1 = class(TForm)
Timer1: TTimer;
procedure FormPaint(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
procedure WMEraseBkgnd(var Message: TMessage); message WM_ERASEBKGND;
{ Public declarations }
end;
var
Form1: TForm1;
i : Integer;
implementation
{$R *.DFM}
procedure TForm1.FormPaint(Sender: TObject);
var
bmp :TBitmap;
bufferCanvas: TCanvas;
ARect :TRect;
begin
ARect:=Rect(0,0,width,height);
bmp:=TBitmap.Create;
bmp.Width:=width;
bmp.Height:=height;
bmp.Canvas.TextOut(0,i,'Hello world');
bmp.Canvas.TextOut(0,i+20,'Welcome to Tsinghua BBS');
Form1.Canvas.CopyRect(ARect,Bmp.Canvas,ARect);
bmp.Destroy;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if i >500 then i:=0;
inc(i);
refresh;
end;
procedure TForm1.WMEraseBkgnd(var Message: TMessage);
begin
Message.Result := 1;
end;
end.