procedure TextToCanvas(mStrings: TStrings; mCanvas: TCanvas; mOffset: TPoint);
var
I: Integer;
vTextHeight: Integer;
begin
with mStrings, mCanvas do
begin
vTextHeight := TextHeight('|');
for I := 0 to Pred(Count) do
TextOut(mOffset.X, mOffset.Y + vTextHeight * I, Strings[I]);
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
const
{$J+}
vTop: Integer = -MaxInt;
{$J-}
begin
if vTop <= -Memo1.Lines.Count * Image1.Canvas.TextHeight('|') then
vTop := Image1.ClientHeight
else
Dec(vTop);
Image1.Canvas.FillRect(Image1.ClientRect);
TextToCanvas(Memo1.Lines, Image1.Canvas, Point(0, vTop));
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
DoubleBuffered := True;
Timer1.Interval := 50;
Timer1.Enabled := True;
end;