把下面的代码放到记事本里 存成form1.frm 然后新建个工程把做好的form1放到工程里 运行一下看看~~VERSION 5.00
Begin VB.Form frmMain
AutoRedraw = -1 'True
BackColor = &H00000000&
Caption = "3DRipple - Use scrollbar to rotate"
ClientHeight = 5895
ClientLeft = 1650
ClientTop = 1545
ClientWidth = 7680
LinkTopic = "Form1"
ScaleHeight = 393
ScaleMode = 3 'Pixel
ScaleWidth = 512
Begin VB.VScrollBar VScroll1
Height = 4395
Left = 240
Max = 359
Min = 1
TabIndex = 0
Top = 480
Value = 45
Width = 255
End
Begin VB.Timer Timer1
Interval = 1
Left = 1320
Top = 960
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option ExplicitConst PI# = 3.14159265358979
Const PI2# = 2 * PI
Const RAD# = PI / 180Const RIPPLES! = 3 ' Number of complete ripples
Const RINGS% = 65 ' Number of rings
Const GAP! = 3 ' Gap between rings, in pixels
Const RIPPLEHEIGHT! = 40 ' Height of ripples, in pixels
Const MAXRAD! = RINGS * GAP ' The maximum radiusPrivate Sub Timer1_Timer()Static Ang!
Dim CntX!, CntY! ' The centre coordinates of each ring
Dim i% Ang = Ang + PI / 10 ' Change to alter rate of oscillation
CntX = (ScaleWidth / 2) Cls ' Clear form. Having AutoRedraw as true stops flicker
For i = 1 To RINGS
CntY = (ScaleHeight / 2) - Cos(Ang - (i / RINGS) * PI2 * RIPPLES) * RIPPLEHEIGHT * (1 - (i / RINGS)) * Cos(VScroll1 * RAD)
Circle (CntX, CntY), i * GAP, RGB(255 - (255 * ((i * GAP) / MAXRAD)), 0, 255 * ((i * GAP) / MAXRAD)), , , Sin(VScroll1 * RAD)
NextEnd Sub
Begin VB.Form frmMain
AutoRedraw = -1 'True
BackColor = &H00000000&
Caption = "3DRipple - Use scrollbar to rotate"
ClientHeight = 5895
ClientLeft = 1650
ClientTop = 1545
ClientWidth = 7680
LinkTopic = "Form1"
ScaleHeight = 393
ScaleMode = 3 'Pixel
ScaleWidth = 512
Begin VB.VScrollBar VScroll1
Height = 4395
Left = 240
Max = 359
Min = 1
TabIndex = 0
Top = 480
Value = 45
Width = 255
End
Begin VB.Timer Timer1
Interval = 1
Left = 1320
Top = 960
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option ExplicitConst PI# = 3.14159265358979
Const PI2# = 2 * PI
Const RAD# = PI / 180Const RIPPLES! = 3 ' Number of complete ripples
Const RINGS% = 65 ' Number of rings
Const GAP! = 3 ' Gap between rings, in pixels
Const RIPPLEHEIGHT! = 40 ' Height of ripples, in pixels
Const MAXRAD! = RINGS * GAP ' The maximum radiusPrivate Sub Timer1_Timer()Static Ang!
Dim CntX!, CntY! ' The centre coordinates of each ring
Dim i% Ang = Ang + PI / 10 ' Change to alter rate of oscillation
CntX = (ScaleWidth / 2) Cls ' Clear form. Having AutoRedraw as true stops flicker
For i = 1 To RINGS
CntY = (ScaleHeight / 2) - Cos(Ang - (i / RINGS) * PI2 * RIPPLES) * RIPPLEHEIGHT * (1 - (i / RINGS)) * Cos(VScroll1 * RAD)
Circle (CntX, CntY), i * GAP, RGB(255 - (255 * ((i * GAP) / MAXRAD)), 0, 255 * ((i * GAP) / MAXRAD)), , , Sin(VScroll1 * RAD)
NextEnd Sub
Begin VB.Form frmMain
AutoRedraw = -1 'True
BackColor = &H00000000&
Caption = "3DRipple - Use scrollbar to rotate"
ClientHeight = 5895
ClientLeft = 1650
ClientTop = 1545
ClientWidth = 7680
LinkTopic = "Form1"
ScaleHeight = 393
ScaleMode = 3 'Pixel
ScaleWidth = 512
Begin VB.VScrollBar VScroll1
Height = 4395
Left = 240
Max = 359
Min = 1
TabIndex = 0
Top = 480
Value = 45
Width = 255
End
Begin VB.Timer Timer1
Interval = 1
Left = 1320
Top = 960
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option ExplicitConst PI# = 3.14159265358979
Const PI2# = 2 * PI
Const RAD# = PI / 180Const RIPPLES! = 3 ' Number of complete ripples
Const RINGS% = 65 ' Number of rings
Const GAP! = 3 ' Gap between rings, in pixels
Const RIPPLEHEIGHT! = 40 ' Height of ripples, in pixels
Const MAXRAD! = RINGS * GAP ' The maximum radiusPrivate Sub Timer1_Timer()Static Ang!
Dim CntX!, CntY! ' The centre coordinates of each ring
Dim i% Ang = Ang + PI / 10 ' Change to alter rate of oscillation
CntX = (ScaleWidth / 2) Cls ' Clear form. Having AutoRedraw as true stops flicker
For i = 1 To RINGS
CntY = (ScaleHeight / 2) - Cos(Ang - (i / RINGS) * PI2 * RIPPLES) * RIPPLEHEIGHT * (1 - (i / RINGS)) * Cos(VScroll1 * RAD)
Circle (CntX, CntY), i * GAP, RGB(255 - (255 * ((i * GAP) / MAXRAD)), 0, 255 * ((i * GAP) / MAXRAD)), , , Sin(VScroll1 * RAD)
NextEnd Sub