Option Explicit Dim x As Long Dim y As Long Private Sub Form_Load() Picture1.AutoRedraw = True Timer1.Interval = 100 Picture1.BackColor = vbBlack Picture1.Scale (0, 50)-(1000, -50) ' 设定自定义座标系统。 Picture1.Line (0, 0)-(1000, 0), vbWhite Picture1.DrawWidth = 2 End SubPrivate Sub Timer1_Timer() x = x + 1 Randomize y = Int((100 * Rnd) + 1) - 50 Text1 = y If y > 10 Then Picture1.PSet (x, y), vbYellow ElseIf y >= -10 And y <= 10 Then Picture1.PSet (x, y), vbRed ElseIf y < -10 Then Picture1.PSet (x, y), vbBlue End If End Sub
Dim x As Long
Dim y As Long
Private Sub Form_Load()
Picture1.AutoRedraw = True
Timer1.Interval = 100
Picture1.BackColor = vbBlack
Picture1.Scale (0, 50)-(1000, -50) ' 设定自定义座标系统。
Picture1.Line (0, 0)-(1000, 0), vbWhite
Picture1.DrawWidth = 2
End SubPrivate Sub Timer1_Timer()
x = x + 1
Randomize
y = Int((100 * Rnd) + 1) - 50
Text1 = y
If y > 10 Then
Picture1.PSet (x, y), vbYellow
ElseIf y >= -10 And y <= 10 Then
Picture1.PSet (x, y), vbRed
ElseIf y < -10 Then
Picture1.PSet (x, y), vbBlue
End If
End Sub
SkyDrive: 实时曲线
要左键点击进入那个网页去下载。
文件链接是这个:源代码-实时出线.rar(1.6KB)
Picture1.AutoRedraw = True
Picture1.BackColor = vbBlack
Picture1.Scale (0, 20)-(200, -20)
'用白色画曲线'
Picture1.ForeColor = vbWhite
Picture1.Line (0, 0)-(50, 20)
Picture1.Line -(150, -20)
Picture1.Line -(200, 0)
'用 And 模式滤色'
Picture1.DrawMode = vbMaskPen
Picture1.Line (0, 10)-(200, 20), vbYellow, BF
Picture1.Line (0, -10)-(200, -20), vbBlue, BF
Picture1.Line (0, 10)-(200, -10), vbRed, BF
End Sub