求一个 画手表 源程序。
要求: 参照Windows操作系统“日期时间 属性”(任务栏右下角时间显示处,又击出来的窗口)中的那个表。
不要用图片,用Canvas。
表面(表大小)最好不要超过90x90象素。
windows自带的那个表是以点表示刻度,能不能不以短线表示。
刻度位置准确。
指针能准确移动(正确指向刻度)。
要求: 参照Windows操作系统“日期时间 属性”(任务栏右下角时间显示处,又击出来的窗口)中的那个表。
不要用图片,用Canvas。
表面(表大小)最好不要超过90x90象素。
windows自带的那个表是以点表示刻度,能不能不以短线表示。
刻度位置准确。
指针能准确移动(正确指向刻度)。
program Clock;
uses
dos,
crt,
graph;const
pi=3.1415926;
var
gd,gm:integer;
procedure init;
begin
initgraph(gm,gd,' ');
end;
procedure drawclock;
begin
moveto(310,220);
circle( 310,220,150);
circle(310,220,140);
moveto(310+140,220);
lineto(310+150,220);
moveto(310,220+140);
lineto(310,220+150);
moveto(310-140,220);
lineto(310-150,220);
moveto(310,220-140);
lineto(310,220-150);
moveto(310+trunc(140*0.5),trunc(220+140*sqrt(3)/2));
lineto(310+trunc(150*0.5),trunc(220+150*sqrt(3)/2));
moveto(310-trunc(140*0.5),trunc(220-140*sqrt(3)/2));
lineto(310-trunc(150*0.5),trunc(220-150*sqrt(3)/2));
moveto(310+trunc(140*0.5),trunc(220-140*sqrt(3)/2));
lineto(310+trunc(150*0.5),trunc(220-150*sqrt(3)/2));
moveto(310-trunc(140*0.5),trunc(220+140*sqrt(3)/2));
lineto(310-trunc(150*0.5),trunc(220+150*sqrt(3)/2));
moveto(310+trunc(140*sqrt(3)/2),trunc(220+140*0.5));
lineto(310+trunc(150*sqrt(3)/2),trunc(220+150*0.5));
moveto(310-trunc(140*sqrt(3)/2),trunc(220-140*0.5));
lineto(310-trunc(150*sqrt(3)/2),trunc(220-150*0.5));
moveto(310+trunc(140*sqrt(3)/2),trunc(220-140*0.5));
lineto(310+trunc(150*sqrt(3)/2),trunc(220-150*0.5));
moveto(310-trunc(140*sqrt(3)/2),trunc(220+140*0.5));
lineto(310-trunc(150*sqrt(3)/2),trunc(220+150*0.5));
end;
procedure drawsec(a:integer);
begin
moveto(310,220);
lineto(trunc(310+100*cos(a*pi/180)),trunc(220+100*sin(a*pi/180)));
end;
procedure drawmin(a:integer);
begin
moveto(310,220);
lineto(trunc(310+70*cos(a*pi/180)),trunc(220+70*sin(a*pi/180)));
end;
procedure drawhou(a:integer);
begin
moveto(310,220);
lineto(trunc(310+45*cos(a*pi/180)),trunc(220+45*sin(a*pi/180)));
end;
procedure setclock;
var
sec,min,hou,t:word;
begin
gettime(hou,min,sec,t);
if hou>12 then hou:=hou-12;
drawsec(trunc(sec*6+270));
drawmin(trunc(min*6+270));
drawhou(trunc(hou*30-90+min/60*30));
repeat
begin
setcolor(0);
delay(1000);
drawsec(trunc(sec*6+270));
drawmin(trunc(min*6+270));
drawhou(trunc(hou*30-90+min/60*30));
gettime(hou,min,sec,t);
setcolor(2);
drawsec(trunc(sec*6+270));
drawmin(trunc(min*6+270));
drawhou(trunc(hou*30-90+min/60*30));
end;
until keypressed;
end;
function setcol:integer;
begin
randomize;
setcol:=(random(maxcolors));
end;
begin
clrscr;
init;
setcolor(2);
{setcolor(setcol);}
drawclock;
setclock;
end.
我以前用turbo PASCAL绘图函数做过一个
现在用DELPHI一样能做
你出价多少?