Sunday, July 31, 2011

Jam

unit Unit1;

interface

uses
Windows, SysUtils, Graphics, Forms, ExtCtrls, Classes;

type
TForm1 = class(TForm)
Timer1: TTimer;
procedure FormPaint(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ By : Zephio
Bikin Jam Unik tp jelek }
public
{ http://amateur-guide.blogspot.com }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}



procedure TForm1.FormPaint(Sender: TObject);
begin
with Form1 do
//------------------------------------------------------------------------------>
// Lingkar Jam
Canvas.Brush.Color := CLTeal;
Canvas.Pen.Color := ClBlue;
Canvas.Ellipse(0, 25, ClientWidth, ClientHeight Div 2);
Canvas.Brush.Color := clFuchsia;
Canvas.Ellipse(0, 25, ClientWidth - 10, ClientHeight Div 2 - 10);
//------------------------------------------------------------------------------>
// Per Detik
Canvas.Pen.Color := clBlue;
Canvas.MoveTo(StrToInt(FormatDateTime('ss', Now)),25);
Canvas.LineTo(StrToInt(FormatDateTime('ss', Now)),ClientHeight Div 2 - 15);
//------------------------------------------------------------------------------>
Canvas.Font.Color := clBlue;
Canvas.Font.Style := [fsBold];
SetBkMode(Canvas.Handle,TRANSPARENT);
Canvas.TextOut(StrToInt(FormatDateTime('ss', Now)), ClientHeight Div 2 - 15, FormatDateTime('ss', Now));
//------------------------------------------------------------------------------>
// Per Menit
Canvas.Pen.Color := clRed;
Canvas.MoveTo(StrToInt(FormatDateTime('nn', Now)),25);
Canvas.LineTo(StrToInt(FormatDateTime('nn', Now)),ClientHeight Div 2 - 30);
//------------------------------------------------------------------------------>
Canvas.Font.Color := clRed;
Canvas.Font.Style := [fsBold];
SetBkMode(Canvas.Handle,TRANSPARENT);
Canvas.TextOut(StrToInt(FormatDateTime('nn', Now)), ClientHeight Div 2 - 30, FormatDateTime('nn', Now));
//------------------------------------------------------------------------------>
//Per Jam
Canvas.Pen.Color := clBlack;
Canvas.MoveTo(StrToInt(FormatDateTime('hh', Now)),25);
Canvas.LineTo(StrToInt(FormatDateTime('hh', Now)), ClientHeight Div 2 - 45);
//------------------------------------------------------------------------------>
Canvas.Font.Color := clBlack;
Canvas.Font.Style := [fsBold];
SetBkMode(Canvas.Handle,TRANSPARENT);
Canvas.TextOut(StrToInt(FormatDateTime('hh', Now)), ClientHeight Div 2 - 45, FormatDateTime('hh', Now));
//------------------------------------------------------------------------------>
// Pesan
Canvas.Brush.Style := BSClear;
Canvas.Font.Color := CLRed;
Canvas.Font.Size := 12;
Canvas.TextOut(ClientWidth Div 3 + 15, 0, 'Clock');
Canvas.Font.Color := CLBlue;
Canvas.Font.Size := 12;
Canvas.TextOut(ClientWidth Div 5, 140, 'Created By : Zephio');
//------------------------------------------------------------------------------>
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Invalidate;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Application.Title := 'ZS Clock';
Form1.Height := 280;
Form1.Width := 256;
DoubleBuffered := true;
end;

end.

No comments:

Post a Comment