1,451
社区成员
发帖
与我相关
我的任务
分享
Private Sub Timer2_Timer() '每180秒画一点,可依据需要改变画点周期
If Label1 <> CStr(Time$) Then
Label1.Caption = Time$
sum_z = sum_z + 1
'校准
If sum_z >= 360 Then
sum_z = sum_z - 360
sum_z1 = sum_z1 + 1
End If
End If
End Sub
Option Explicit
Dim sum_z As Integer
Dim sum_z1 As Integer
Dim colvb As Long
Dim xx As Integer
Dim yy As Integer
Dim txt As String
Dim wp As Long
Dim i As Integer
Dim record_jm(6) As Single '可将本变量在标准模块中定义为全局变量
Private Sub Form_Load()
Timer1.Interval = 500
Timer2.Interval = 500
Picture1.BackColor = vbWhite
Picture1.AutoRedraw = True
colvb = vbBlack
xx = 100
yy = 150
txt = "℃"
wp = xp(colvb, xx, yy, txt)
xx = 200
yy = 350
txt = "50"
wp = xp(colvb, xx, yy, txt)
xx = 200
yy = 1850
txt = "40"
wp = xp(colvb, xx, yy, txt)
yy = 3350
xx = 200
txt = "30"
wp = xp(colvb, xx, yy, txt)
xx = 200
yy = 4850
txt = "20"
wp = xp(colvb, xx, yy, txt)
xx = 200
yy = 6350
txt = "10"
wp = xp(colvb, xx, yy, txt)
'Time坐标
colvb = vbRed
yy = 6500
xx = 400
txt = "0"
wp = xp(colvb, xx, yy, txt)
xx = 1480
txt = "5"
wp = xp(colvb, xx, yy, txt)
xx = 2560
txt = "10"
wp = xp(colvb, xx, yy, txt)
xx = 3640
txt = "15"
wp = xp(colvb, xx, yy, txt)
xx = 4720
txt = "20"
wp = xp(colvb, xx, yy, txt)
xx = 5800
txt = "25 min"
wp = xp(colvb, xx, yy, txt)
xx = 6880
txt = "30"
wp = xp(colvb, xx, yy, txt)
xx = 7960
txt = "35"
wp = xp(colvb, xx, yy, txt)
xx = 9040
txt = "40"
wp = xp(colvb, xx, yy, txt)
xx = 10120
txt = "45"
wp = xp(colvb, xx, yy, txt)
xx = 11200
txt = "50"
wp = xp(colvb, xx, yy, txt)
'画格
For i = 0 To 39
Picture1.Line (450, 550 + i * 150)-(500, 550 + i * 150)
Next
Picture1.DrawStyle = 2
For i = 0 To 8
Picture1.Line (450, 400 + i * 750)-(11300, 400 + i * 750)
Next
For i = 0 To 15
Picture1.Line (450, 1000 + i * 300)-(500, 1000 + i * 300)
Next
For i = 0 To 10
Picture1.Line (500 + i * 1080, 400)-(500 + i * 1080, 6400)
Next
Picture1.DrawStyle = 0
End Sub
Public Function xp(colvb As Variant, xx As Variant, yy As Variant, txt As Variant)
Picture1.ForeColor = colvb 'QBColor(14)
Picture1.CurrentX = xx
Picture1.CurrentY = yy
Picture1.Print txt '
End Function
Private Sub Timer1_Timer()
Picture1.DrawStyle = 0
'画图变量,可由程序的其它窗体接收后传递过来。
record_jm(0) = 12
record_jm(1) = 20
record_jm(2) = 42
record_jm(3) = 32
record_jm(4) = 35
record_jm(5) = 48
Picture1.DrawWidth = 3
Picture1.PSet (sum_z1 * 18 + 500, record_jm(0) * -150 + 7900), vbRed
Picture1.PSet (sum_z1 * 18 + 500, record_jm(1) * -150 + 7900), vbCyan
Picture1.PSet (sum_z1 * 18 + 500, record_jm(2) * -150 + 7900), vbBlack
Picture1.PSet (sum_z1 * 18 + 500, record_jm(3) * -150 + 7900), vbMagenta
Picture1.PSet (sum_z1 * 18 + 500, record_jm(4) * -150 + 7900), vbGreen
Picture1.PSet (sum_z1 * 18 + 500, record_jm(5) * -150 + 7900), vbBlue
End Sub
Private Sub Timer2_Timer() '每2.5秒画一点,可依据需要改变画点周期
If Label1 <> CStr(Time$) Then
Label1.Caption = Time$
sum_z = sum_z + 1
'校准
If sum_z >= 5 Then
sum_z = sum_z - 5
sum_z1 = sum_z1 + 1
End If
End If
End Sub