顶起,把代码放出来让大家学习.
Vars("时针指数") = date.now().Hour Vars("分针指数") = date.now().Minute Vars("秒针指数") = date.now().Second Dim p As WinForm.Painter = e.Form.Controls("Painter1") Dim g As Graphics = p.Graphics Dim 秒针 As New Pen(Color.Red,1) Dim 分针 As New Pen(Color.DarkSlateGray,2) Dim 时针 As New Pen(Color.Black,2) g.Clear(Color.WhiteSmoke) If FileSys.FileExists(DataTables("表B").DataRows(0)("系统安装路径") & DataTables("表A").DataRows(0)("时钟类型") & ".png") then g.DrawImage(getImage(DataTables("表B").DataRows(0)("系统安装路径") & DataTables("表A").DataRows(0)("时钟类型") & ".png"),0,0,120,120) g.DrawPie(时针,40,40,40,40,((Vars("时针指数"))* 30 +(Vars("分针指数"))\2+(Vars("秒针指数"))\30+270) mod 360,1) g.DrawPie(分针,35,35,50,50,((Vars("分针指数"))* 6 +(Vars("秒针指数"))\12+270) mod 360,1) g.DrawPie(秒针,25,25,70,70,((Vars("秒针指数"))*6+270) mod 360,1) p.Repaint() end if
|