Public Class Form1 Dim g As Graphics Dim b As Bitmap Dim FrameCount As UInteger = 0 Dim FPS As UInteger = 0 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load b = New Bitmap(Me.ClientRectangle.Width, Me.ClientRectangle.Height) g = Graphics.FromImage(b) Timer1.Start() Timer2.Start() Timer3.Start() End Sub Dim IsShowingF3 As Boolean = False Dim Color1, Color2 As Color Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick '色設定 Color1 = Color.FromArgb(255, Now.Hour / 24 * 255, Now.Minute / 60 * 255, Now.Second / 60 * 255) Color2 = Color.FromArgb(Color1.ToArgb Xor &HFFFFFF) 'Graphics.Clear(Color1) g.Clear(Color1) '針 Dim Bru As New SolidBrush(Color2) Dim Penmsec As New Pen(Color2, 2) Dim Pensec As New Pen(Color2, 4) Dim Penmin As New Pen(Color2, 6) Dim Penhr As New Pen(Color2, 8) Dim msecx, msecy As Integer Dim secx, secy As Integer Dim minx, miny As Integer Dim hrx, hry As Integer Dim thetas As Double thetas = (((Now.Second / 60) * 360) - 90) * Math.PI / 180 secx = Math.Cos(thetas) * 225 secy = Math.Sin(thetas) * 225 Dim thetams As Double thetams = (((Now.Millisecond / 1000) * 360) - 90) * Math.PI / 180 msecx = Math.Cos(thetams) * 250 msecy = Math.Sin(thetams) * 250 Dim thetamin As Double thetamin = (((Now.Minute / 60) * 360) - 90) * Math.PI / 180 minx = Math.Cos(thetamin) * 200 miny = Math.Sin(thetamin) * 200 Dim thetahr As Double thetahr = (((IIf(Now.Hour > 12, Now.Hour - 12, Now.Hour) / 12) * 360) - 90) * Math.PI / 180 hrx = Math.Cos(thetahr) * 175 hry = Math.Sin(thetahr) * 175 g.DrawLine(Penmsec, New Point(msecx + (b.Width / 2), msecy + (b.Height / 2)), New Point(b.Width / 2, b.Height / 2)) 'ミリ秒 g.DrawLine(Pensec, New Point(secx + (b.Width / 2), secy + (b.Height / 2)), New Point(b.Width / 2, b.Height / 2)) '秒 g.DrawLine(Penmin, New Point(minx + (b.Width / 2), miny + (b.Height / 2)), New Point(b.Width / 2, b.Height / 2)) '分 g.DrawLine(Penhr, New Point(hrx + (b.Width / 2), hry + (b.Height / 2)), New Point(b.Width / 2, b.Height / 2)) '時 '外側の棒? (中略) Dim WStr As String = Now.ToString g.DrawString(WStr, New Font(Me.Font.FontFamily, 24), Brushes.White, New Point(1, 1)) g.DrawString(WStr, New Font(Me.Font.FontFamily, 24), Brushes.White, New Point(-1, 0)) g.DrawString(WStr, New Font(Me.Font.FontFamily, 24), Brushes.White, New Point(0, -1)) g.DrawString(WStr, New Font(Me.Font.FontFamily, 24), Brushes.White, New Point(-1, -1)) g.DrawString(WStr, New Font(Me.Font.FontFamily, 24), Brushes.White, New Point(1, 0)) g.DrawString(WStr, New Font(Me.Font.FontFamily, 24), Brushes.White, New Point(0, 1)) g.DrawString(WStr, New Font(Me.Font.FontFamily, 24), Bru, New Point(0, 0)) 'デジタル Me.BackgroundImage = b Me.Refresh() FrameCount += 1 End Sub (中略) End Class