unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Timer1: TTimer;
Image2: TImage;//背景图片
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
J: Integer;//保存Image1的高度
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
Timer1.Enabled:=True;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
J:=Image1.Height;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
i:integer;
begin
Image1.Canvas.Lock;
Image1.Canvas.Brush.Style := bsSolid ;
Image1.Canvas.Font.Color := clBlack;
Image1.Canvas.Font.Size:=10;
For i:=0 to Memo1.Lines.Count-1 do
Image1.Canvas.TextOut(1,J+i*2*Image1.Canvas.Font.Size,Memo1.Lines.Strings);
Dec(j);
Image1.Canvas.Unlock;
end;
end.
以上程序在 Delphi 5.0+Win98下通过,效果自认为还不错