var
Form1: TForm1;
coul : TColor;
dh : TDateTime;
s, s2 : LongInt;
xp, yp, R : Integer;
//
procedure TForm1.FormResize(Sender: TObject);
begin
Bevel1.Width := Form1.ClientWidth - 16;
Bevel1.Height := Form1.ClientHeight - 16 - 65;
PaintBox1.Width := Form1.ClientWidth - 18;
PaintBox1.Height := Form1.ClientHeight - 18 - 65;
Panel1.Width := Form1.ClientWidth - 16;
Panel2.Width := Form1.ClientWidth - 16;
Panel1.Top := Form1.ClientHeight - 16 - 48;
Panel2.Top := Form1.ClientHeight - 16 - 15;
if PaintBox1.Width <= PaintBox1.Height then R := PaintBox1.Width div 2 - PaintBox1.Width div 10
else R := PaintBox1.Height div 2 - PaintBox1.Height div 10;
xp := PaintBox1.Width div 2;
yp := PaintBox1.Height div 2;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
DoubleBuffered := true;
coul := clLime;
if PaintBox1.Width <= PaintBox1.Height then R := PaintBox1.Width div 2 - PaintBox1.Width div 10
else R := PaintBox1.Height div 2 - PaintBox1.Height div 10;
xp := PaintBox1.Width div 2;
yp := PaintBox1.Height div 2;
end;
procedure TForm1.ColorClick(Sender: TObject);
begin
if ColorDialog1.Execute then begin
coul := ColorDialog1.Color;
PaintBox1.Repaint;
Panel1.Font.Color := coul;
Panel2.Font.Color := coul;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var asec, amin, ahour : Real;
begin
dh := Now;
if Panel2.Caption <> DateToStr(dh) then Panel2.Caption := DateToStr(dh);
//DecodeTime(dh, h, m, s, ms);
//if (h < 10) then Panel1.Caption := '0' + IntToStr(h) + ':'
//else Panel1.Caption := IntToStr(h) + ':';
//if (m < 10) then Panel1.Caption := Panel1.Caption + '0' + IntToStr(m) + ':'
//else Panel1.Caption := Panel1.Caption + IntToStr(m) + ':';
//if (s < 10) then Panel1.Caption := Panel1.Caption +'0' + IntToStr(s)
//else Panel1.Caption := Panel1.Caption + IntToStr(s);
s := SecondOfTheDay(dh);
if s <> s2 then begin
PaintBox1.Repaint;
if Panel1.Caption <> TimetoStr(dh) then Panel1.Caption := TimetoStr(dh);
PaintBox1.Canvas.Pen.Color := coul;
PaintBox1.Canvas.MoveTo(xp, yp);
asec := s*Pi/30;
PaintBox1.Canvas.LineTo(xp+round(R*cos(asec-Pi/2)), yp+round(R*sin(asec-Pi/2)));
PaintBox1.Canvas.MoveTo(xp, yp);
amin := s*Pi/1800;
PaintBox1.Canvas.LineTo(xp+round((2*R/3)*cos(amin-Pi/2)), yp+round((2*R/3)*sin(amin-Pi/2)));
PaintBox1.Canvas.MoveTo(xp, yp);
ahour := s*Pi/21600;
PaintBox1.Canvas.LineTo(xp+round((R/3)*cos(ahour-Pi/2)), yp+round((R/3)*sin(ahour-Pi/2)));
end;
s2 := s;
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
var
i : integer;
a : Real;
myrect, minir : TRect;
begin
myrect := Rect(0, 0, PaintBox1.Width, PaintBox1.Height);
PaintBox1.Canvas.Brush.Color := clBlack;
PaintBox1.Canvas.FillRect(myrect);
for i:= 0 to 11 do begin
a := i*Pi/6;
minir := Rect(xp+round(R*cos(a))-2, yp+round(R*sin(a))-2, xp+round(R*cos(a))+2, yp+round(R*sin(a))+2);
PaintBox1.Canvas.Brush.Color := coul;
PaintBox1.Canvas.FillRect(minir);
end;
end;
procedure TForm1.FormConstrainedResize(Sender: TObject; var MinWidth,
MinHeight, MaxWidth, MaxHeight: Integer);
begin
MinWidth := 90;
MinHeight := 170;
end;
Draw Animate Analog Clock
Abonnieren
Posts (Atom)
Beliebte Posts
-
Network Source Code Update Source Code Network Update : https://asciigen.blogspot.com/p/network.html Send Message 1.0 Source Server Client ...
-
Windows Key Sniffer 0.82 - Update 08/2024 Der Windows Key Sniffer hat mir im Laufe der Zeit viel Arbeit erspart und unterstützt, viele Wi...
-
Windows Defender Bypass Version 0.75 - Update 11/2024 Den Windows 10-eigenen Virenschutz Defender kann man auf mehreren Wegen abschalten,...
-
ASCii GIF Animator Update Version 0.68 (32 bit) - 11/2024 Bei dieser überarbeiteten Version ist die Kompatibilität zu den verschiedenen GIF...
-
MD5 Hacker v.0.26 - Update 08.2024 MD5 Hashs sollten eigentlich nicht entschlüsselt werden können. Jedoch gibt es Tools, mit welchen auch ...
-
Host Editor Version 0.64 - Update 11/2024 Hosts File Editor allows for the easy editing of host files and backup creation. Create your own h...
-
Dir Sniffer Version 0.08 - Update 08/2024 Dir Sniffer ist ein kleines aber nützliches Tool um herauszufinden, was ihr Programm auf ihrem...
-
Oldskool Font Generator v.0.29 - Update 11/2023 Das Tool stell 508 Bitmap Fonts zu Verfügung. Eigene Fonts können integriert werden, sie...
-
ASCii Text Creator v.0.24 - Update 11.2023 * Add BugFix Gui Move Message Send * Add 447 Figlet Font Pack * Fixed Invert Unicode Function * ...
Keine Kommentare:
Kommentar veröffentlichen