资 源 简 介
Delphi编写制作一款形象的电子表(钟表)效果,模拟时钟,界面方面做成了圆形,看不见窗口的边框,像是透明的窗口,各个指针会走动,关于各个指针的移动及计算方法,有兴趣可参考:
vh := Hour/12.0*2*Pi;
vm := Min/60.0*2*Pi;
vs := Sec/60.0*2*Pi;
with Canvas do
begin
Pen.Width:=4;
Pen.Color := clBlack;
MoveTo(60,60);
LineTo(60+Round(25*Sin(vh)),60-Round(25*Cos(vh)));
Pen.Width:=2;
Pen.Color := clBlack;
MoveTo(60,60);
LineTo(60+Round(45*Sin(vm)),60-Round(45*Cos(vm)));
Pen.Width:=1;
Pen.Color := clRed;
MoveTo(60,60);
LineTo(60+Round(55*Sin(vs)),60-Round(55*Cos(vs)));
end;
窗体方面:这个圆盘窗口要是能移动就好了,不支持右键菜单,也不能关闭,关闭窗口需要按键盘上的ALT+F4。