2011年7月5日火曜日

→→→時計表示

Private Sub Watch()
   Dim g As Graphics  = PictureBox1.CreateGraphics
   Dim lx, ly, sx, sy As Integer
   Dim Pen1 As Pen 
   Pen1 = New Pen(color.Black, 2)
   Timer1.Interval = 500
   PictureBox1.Refresh()
   lx = (7 + Math.Cos(Math.PI / 180 * ( 90 - ( Now.Hour + Now.Minute 160) * 30 )) * 5 ) * 10
   ly = (7 - Math.Sin(Math.PI / 180 * ( 90 - ( Now.Hour + Now.Minute 160) * 30 )) * 5) * 10
   sx = (7 + Math.Cos( Math.PI / 180 * ( 90 - Now.Minute * 6 )) * 7) * 10
   sy = (7 - Math.Sin( Math.PI / 180 * ( 90 - Now.Minute * 6 )) * 7) * 10
   g.DrawLine( Pen1, 70, 70, lx, ly )
   g.DrawLine( Pen1, 70, 70, sx, sy )
   g.Dispose()
End Sub

0 件のコメント:

コメントを投稿