Dim s1, s2, a, r, g, b, co1, vr, vg, vb Dim lasttime, times, fpsPrivate Sub Form_Load() If App.PrevInstance = True Then End Randomize co1 = vbBlack co2 = vbWhite Show vb = 1 vr = 1 vg = 1 lasttime = Timer fps = 120 r = Rnd * 255 g = Rnd * 255 b = Rnd * 255 Do 's1 = g * 100 / 4 's2 = s1 / 4 If r < 5 Then vr = 1 If r > 250 Then vr = -1
If g < 5 Then vg = 1 If g > 250 Then vg = -1 If b < 5 Then vb = 1 If b > 250 Then vb = -1 r = r + 0.2 * vr * 110 / fps g = g + 0.4 * vg * 110 / fps b = b + 0.6 * vb * 110 / fps co1 = RGB(r, g, b) co2 = RGB(255 - r, 255 - g, 255 - b) a = a + 1 / 57.2 * 110 / fps FillColor = co1 Circle (Sin(a) * s1, Cos(a) * s1), s1, co1 FillColor = co2 Circle (Sin(a) * s1, Cos(a) * s1), s2, co2 FillColor = co2 Circle (Sin(a + 180 / 57.2) * s1, Cos(a + 180 / 57.2) * s1), s1, co2 FillColor = co1 Circle (Sin(a + 180 / 57.2) * s1, Cos(a + 180 / 57.2) * s1), s2, co1 t = Timer times = times + 1 If t - lasttime >= 1 Then Line (-Height / 2, -Width / 3)-(-Height / 2 + 500, -Width / 3 + 200), vbBlack, BF fps = times / (t - lasttime) ForeColor = co2 CurrentX = -Height / 2 CurrentY = -Width / 3 Print Int(times / (t - lasttime)) times = 0 lasttime = Timer End If DoEvents Loop End Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) End End Sub Private Sub Form_Resize() ScaleTop = -Height / 2 ScaleLeft = -Width / 2 s1 = Height / 4 - 200 s2 = s1 / 2 End Sub
|