Programalama > DELPHI

Etiketler: analog, saat

Ort. 0
Puan ver:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
procedure TForm1.Timer1Timer(Sender: TObject);
begin
        Min_Check:=min;
        Hour_Check:=hour;
        tid:=timetostr(time);
        ss:= tid[7] +tid[8];
        sek:=strtoint(ss);
        m:= tid[4] +tid[5];
        min:=strtoint(m);
        h:= tid[1] +tid[2];
        hour:=strtoint(h);
 
        if (min_check <> min) then
                Min_Update:=true;
 
        if (Hour_Check <> Hour) then
                Hour_Update:=true;
        form1.Canvas.Pen.Width :=1;
        form1.Canvas.pen.Color:=clwhite;
        form1.Canvas.LineTo(strtoint(floattostr(oldx)),strtoint(floattostr(oldy))) ;
        form1.Canvas.LineTo(strtoint(floattostr(midx)),strtoint(floattostr(midy))) ;
 
        HourX1 := s * Cos((Pi / 180) * (30 * hour - 90)) + MidX;
        HourY1 := s * Sin((Pi / 180) * (30 * hour - 90)) + MidY;
 
        MinX1 := s * Cos((Pi / 180) * (6 * Min - 90)) + MidX;
        MinY1 := s * Sin((Pi / 180) * (6 * Min - 90)) + MidY;
 
        X1 := s * Cos((Pi / 180) * (6 * sek - 90)) + MidX;
        Y1 := s * Sin((Pi / 180) * (6 * sek - 90)) + MidY ;
        x:=int(x1);
        y:=int(y1);
        OldXMin := XMin ;
        OldYMin := YMin ;
        XMin:=int(MinX1);
        YMin:=int(MinY1);
        OldXHour:=XHour;
        OldYHour:=YHour;
        XHour:=int(HourX1);
        YHour:=int(HourY1);
         
        form1.Canvas.pen.Color:=clred;
        form1.Canvas.Pen.Width :=1;
        form1.Canvas.LineTo(strtoint(floattostr(x)),strtoint(floattostr(y))) ;
        form1.Canvas.LineTo(strtoint(floattostr(midx)),strtoint(floattostr(midy))) ;
        OldX := X ;
        OldY := Y ;
        if (Min_Update=true) then
        begin
                 
                form1.Canvas.pen.Color:=clwhite;
                form1.Canvas.LineTo(strtoint(floattostr(OldXMin)),strtoint(floattostr(OldYMin))) ;
                form1.Canvas.LineTo(strtoint(floattostr(MidX)),strtoint(floattostr(MidY))) ;
                Min_Update:=false;
        end;
 
        form1.Canvas.pen.Color:=clblack;
        form1.Canvas.LineTo(strtoint(floattostr(XMin)),strtoint(floattostr(YMin))) ;
        form1.Canvas.LineTo(strtoint(floattostr(MidX)),strtoint(floattostr(MidY))) ;
 
        if (Hour_Update=true) then
        begin
                form1.Canvas.Pen.Width :=3;
                form1.Canvas.pen.Color:=clwhite;
                form1.Canvas.LineTo(strtoint(floattostr(OldXHour)),strtoint(floattostr(OldYHour))) ;
                form1.Canvas.LineTo(strtoint(floattostr(MidX)),strtoint(floattostr(MidY))) ;
                Hour_Update:=false;
        end;
        form1.Canvas.Pen.Width :=3;
        form1.Canvas.pen.Color:=clblack;
        form1.Canvas.LineTo(strtoint(floattostr(XHour)),strtoint(floattostr(YHour))) ;
        form1.Canvas.LineTo(strtoint(floattostr(MidX)),strtoint(floattostr(MidY))) ;
         
end;
 
procedure TForm1.FormShow(Sender: TObject);
begin
        form1.Width :=200;
        form1.Height:=200;
 
 
        s := Form1.Width * 0.3;
        MidX := 50;
        MidY := 50;
        form1.Canvas.LineTo(strtoint(floattostr(midx)),strtoint(floattostr(midy))) ;
        oldx:=midx;
        oldy:=midy;
        form1.Canvas.Pen.Color :=clblack;
        form1.Canvas.Ellipse(0,0,100,100);
        form1.Canvas.Pen.Width :=8;
end;
//ekranda sadece akrep yelkoval ve saniye gözükecektir
//saat ler için ayrı ayrı shape ekleyebilirsiniz
//eğer her saat için bi shape eklemek isterseninz
// formun wiev as tet kısmına bunları yazmanız gerekmektedir
//tabi shapeleri ekledikden sonra
  object Shape2: TShape
    Left = 48
    Top = 0
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape3: TShape
    Left = 0
    Top = 48
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape4: TShape
    Left = 88
    Top = 48
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape5: TShape
    Left = 25
    Top = 4
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape6: TShape
    Left = 69
    Top = 85
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape7: TShape
    Left = 85
    Top = 70
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape8: TShape
    Left = 48
    Top = 88
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape9: TShape
    Left = 6
    Top = 70
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape10: TShape
    Left = 5
    Top = 24
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape11: TShape
    Left = 69
    Top = 4
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape12: TShape
    Left = 25
    Top = 85
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape13: TShape
    Left = 86
    Top = 24
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
  end
  object Shape14: TShape
    Left = 48
    Top = 48
    Width = 5
    Height = 5
    Brush.Color = clRed
    Shape = stCircle
  end


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2025 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.