S
shy_cm
Unregistered / Unconfirmed
GUEST, unregistred user!
Private Sub Picture1_Click()
Dim i As Integer
Dim x, y0, y1, y2 As Integer
Dim middle1 Asdo
uble
'Picture1.DrawStyle = 0
Picture1.Cls
Picture1.Scale (0, 0)-(1000, 400)
Picture1.Line (0, 60)-(1000, 60), RGB(0, 0, 0)
Picture1.Line (0, 160)-(1000, 160), RGB(0, 0, 0)
Picture1.Line (0, 260)-(1000, 260), RGB(0, 0, 0)
middle1 = (10000# / 100) '根据量程,计算单位象素分配的值 */
y0 = 200 - ((((dat(0) And &HFFF)) * (10000# / 4096#) - 5000#) / middle1)
'y0 = 60
x = 1: di = 4
For i = 0 To 5000 Step di
y1 = ((((dat(i) And &HFFF)) * (10# / 4096#) - 5#)) * 10
y2 = ((((dat(i + di) And &HFFF)) * (10# / 4096#) - 5#)) * 10
Picture1.Line (x, y0 - y1)-(x + 1, y0 - y2), RGB(255, 0, 0)
y1 = ((((dat(i + 1) And &HFFF)) * (10# / 4096#) - 5#)) * 10
y2 = ((((dat(i + 1 + di) And &HFFF)) * (10# / 4096#) - 5#)) * 10
Picture1.Line (x, y0 + 100 - y1)-(x + 1, y0 + 100 - y2), RGB(0, 255, 0)
y1 = ((((dat(i + 2) And &HFFF)) * (10# / 4096#) - 5#)) * 10
y2 = ((((dat(i + 2 + di) And &HFFF)) * (10# / 4096#) - 5#)) * 10
Picture1.Line (x, y0 + 200 - y1)-(x + 1, y0 + 200 - y2), RGB(0, 0, 255)
x = x + 1
Next i
End Sub