www.pudn.com > VB_SNOW.rar > Form1.frm
VERSION 5.00
Object = "{F5BE8BC2-7DE6-11D0-91FE-00C04FD701A5}#2.0#0"; "AgentCtl.dll"
Begin VB.Form Form1
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 4485
ClientLeft = 0
ClientTop = 0
ClientWidth = 8040
LinkTopic = "Form1"
ScaleHeight = 4485
ScaleWidth = 8040
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
WindowState = 2 'Maximized
Begin VB.PictureBox Picture1
Height = 3135
Left = 360
ScaleHeight = 3075
ScaleWidth = 6675
TabIndex = 0
Top = 480
Width = 6735
End
Begin AgentObjectsCtl.Agent Agent1
Left = 1560
Top = 3600
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Type h
X As Integer
Y As Integer
c As Long
End Type
Dim xh(1000) As h
Dim picw As Long
Dim pich As Long
Dim bgcolor
Private Sub Form_Load()
Form1.Caption = "雪雪花飘飘"
Picture1.Picture = LoadPicture(App.Path & "\snow2.bmp")
With Picture1
.Top = 0
.Left = (Form1.ScaleWidth = Picture1.ScaleWidth) / 2 - 1.5
.AutoRedraw = True
.AutoSize = True
.ScaleMode = 3
End With
picw = Picture1.ScaleWidth
pich = Picture1.ScaleHeight
bgcolor = Picture1.Point(1, 1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Picture1.Left = (Form1.ScaleWidth = Picture1.ScaleWidth) / 2
picw = Picture1.ScaleWidth
pich = Picture1.ScaleHeight
End Sub
Private Sub Picture1_Click()
Dim i
Dim speedx, speedy
Picture1.Cls
For i = 1 To 1000
xh(i).Y = Int(Rnd(1) * (-pich))
xh(i).X = Int(Rnd(1) * picw)
Next i
Do
DoEvents
For i = 1 To 1000
If xh(i).c = bgcolor Then
Picture1.PSet (xh(i).X, xh(i).Y), xh(i).c
Else
xh(i).Y = Int(Rnd(1) * (pich))
xh(i).X = Int(Rnd(1) * picw)
End If
If xh(i).Y > pich Then
xh(i).Y = Int(Rnd(1) * (-pich))
xh(i).X = Int(Rnd(1) * picw)
End If
speedx = 1 - Rnd(1) * 2
speedy = Rnd(1) * 2
xh(i).Y = xh(i).Y + speedy
xh(i).X = xh(i).X + speedx
xh(i).c = Picture1.Point(xh(i).X, xh(i).Y)
Picture1.PSet (xh(i).X, xh(i).Y), &H80000005
Next i
Loop
End Sub
Private Sub Picture1_DblClick()
End
End Sub