模拟电子钟 带语音报时功能
x = (1–Sin((a+1)/12*2*3.1415926)) * ( Form1.ScaleHeight/2–800)+800 y = (1–Cos((a+1)/12*2*3.1415926)) * ( Form1.ScaleHeight/2–800)+800 Line (Form1.ScaleHeight/2,Form1.ScaleHeight/2)-(x,y),QBColor(7) '开始画後一秒的线
x = (1–Sin(a/12*2*3.1415926))*(Form1.ScaleHeight/2–800)+800 y = (1–Cos(a/12*2*3.1415926))*(Form1.ScaleHeight/2–800)+800 Line (Form1.ScaleHeight/2,Form1.ScaleHeight/2)-(x,y),QBColor ( 1 ) xianshishi=a-1 End Function
‘ = = = = = = = = = = = = = = = = = = = = = = = = = = ‘下面代码作用是画出秒针走的路线 ‘秒针是六十个刻度,表示是六十个秒点
‘ = = = = = = = = = = = = = = = = = = = = = = = = = = Private Function xianshimiao ( a As Integer ) '抹除前一次画的线
x =(1–Sin((a+1)/59*2*3.1415926))*(Form1.ScaleHeight/2–200)+200 y =(1–Cos((a+1)/60*2*3.1415926))*(Form1.ScaleHeight/2–200)+200 Line(Form1.ScaleHeight/2,Form1.ScaleHeight/2)-(x,y),QBColor(7) '开始画後一秒的线
x = (1–Sin(a/59*2*3.1415926))*(Form1.ScaleHeight/2–200)+200 y = (1–Cos(a/60*2*3.1415926))*(Form1.ScaleHeight/2–200)+200 Line ( Form1.ScaleHeight/2 ,Form1.ScaleHeight/2)-(x,y),QBColor(1) xianshimiao = a - 1 End Function
‘ = = = = = = = = = = = = = = = = = = = = = = = = = = ‘下面代码作用是画出分针走的路线 ‘分针是六十个刻度,表示是六十个分点
‘ = = = = = = = = = = = = = = = = = = = = = = = = = = Private Function xianshifen ( a As Integer ) '抹除前一次画的线
x =(1–Sin((a+1)/59 * 2 * 3.1415926)) * ( Form1.ScaleHeight/2–400)+400 y =(1–Cos((a+1)/60 * 2 * 3.1415926)) * ( Form1.ScaleHeight/2–400)+400 Line (Form1.ScaleHeight/2,Form1.ScaleHeight/2)-(x,y),QBColor(7) '开始画後一秒的线
x =(1–Sin(a/59*2*3.1415926)) * (Form1.ScaleHeight/2–400) + 400 y =(1–Cos(a/60*2*3.1415926)) * (Form1.ScaleHeight/2–400) + 400 Line (Form1.ScaleHeight/2, Form1.ScaleHeight/2)-(x,y),QBColor(1)
xianshifen = a - 1 End Function
‘ = = = = = = = = = = = = = = = = = = = = = = = =
‘ 每秒钟触发一次此事件,从而获取当时的时间,并调用相应的函数,画出三个针的位置 ‘ = = = = = = = = = = = = = = = = = = = = = = = = Private Sub Timer1 _ Timer ( ) miao = Second (time)