Dim green As Integer
Dim blue As Integer
Private Sub Form_Click()
End
End Sub
Private Sub Timer1_Timer()
Dim x As Integer
Dim y As Integer
Dim i As Integer
Do Until i = 1000
i = i + 1
x = Rnd * ScaleWidth
y = Rnd * ScaleWidth
PSet (x, y), RGB(red, green, blue)
Loop
End Sub
Private Sub Timer2_Timer()
Form1.Cls
red = 255 * Rnd
green = 255 * Rnd
blue = 255 * Rnd
Timer1.Enabled = True
End Sub
加个Command按钮,加个Timer计时器Dim n As Integer, x() As Integer, y() As Integer, dx() As Integer
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
n = 36
ReDim x(1 To n), y(1 To n), dx(1 To n)
Command1.Caption = "结束"
Timer1.Interval = 100
Me.BackColor = vbBlack
End Sub
Private Sub Form_Resize()
Randomize
For i = 1 To n
x(i) = Me.ScaleWidth * (0.9 * Rnd)
y(i) = Me.ScaleHeight * (0.9 * Rnd)
dx(i) = 12
Next
End Sub
Private Sub Timer1_Timer()
Static flag As Boolean
Cls
If flag = False Then
For i = 1 To n
CurrentX = x(i)
CurrentY = y(i)
Me.FontSize = dx(i)
Me.ForeColor = vbYellow
Print "★"
Next
End If
flag = Not flag
End Sub
其实说到效果,不过就是运算加绘图庆裂哗运行轨迹不用太难,算个圆弧就行了,打印就点就行了,想要好看的点,就自己多加点小誉行处源轮理或者用图片就好了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)