unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 =
class(TForm)
Timer1: TTimer;
Label1: TLabel;
OpenDialog1: TOpenDialog;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
// procedure FormPaint(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
Nachricht:
string;
Canv: TCanvas;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled :=
not Timer1.Enabled;
case Timer1.Enabled
of
True:
begin
Canv.Font.Color := clBlack;
//Position zur Ausgabe der Schrift
Canv.textout(Screen.Width
div 2 - Canv.TextWidth(Nachricht)
div 2,
Screen.Height
div 2 - Canv.TextHeight(Nachricht)
div 2, Nachricht);
Application.ProcessMessages;
sleep(1000);
end;
False:
begin
Application.ProcessMessages;
Canv.Font.Color := clWhite;
//Position zur Ausgabe der Schrift
Canv.textout(Screen.Width
div 2 - Canv.TextWidth(Nachricht)
div 2,
Screen.Height
div 2 - Canv.TextHeight(Nachricht)
div 2, Nachricht);
Refresh;
sleep(1000);
end;
end;
Timer1Timer(Self);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Canv := TCanvas.create;
Canv.handle := GetWindowDC(0);
OpenDialog1.Execute;
Nachricht := ExtractFileName(OpenDialog1.FileName);
with canv
do
begin
font.
name := '
Arial';
font.size := 24;
brush.style := bsclear;
Pen.Mode := pmNot;
end;
Timer1.Enabled := True;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Canv.Free;
end;
end.