grafico
Publicado por scorpionhack (120 intervenciones) el 20/02/2006 23:12:08
Buenas:
Tengo el siguiente codigo que me permite hacer una grafica con los bytes que me llegan por el control winsock. en la cordenada de las y se puede ver los bytes y en la cordenada de las x el tiempo en segundos, pero no consigo que funcione haber si alguien me puede ayudar.
gracias
Option Explicit
Dim Bytes As Long
Dim x As Long
Dim lastx As Long
Dim lasty As Long
Private Sub Command1_Click()
wsk.LocalPort = 80
wsk.Listen
End Sub
Private Sub Command2_Click()
Picture1.Line (x, Text1)-(x + 1, Text1 + 1)
End Sub
Private Sub Form_Load()
x = 0
lastx = x
lasty = Picture1.Height
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
wsk.Close
End Sub
Private Sub Timer1_Timer()
Picture1.Line (lastx, lasty)-(x + 10, Picture1.Height - Bytes)
x = x + 10
If x >= Picture1.Width Then x = Picture1.Width
lastx = x
lasty = Picture1.Height - Bytes
Bytes = 0
End Sub
Private Sub wsk_ConnectionRequest(ByVal requestID As Long)
wsk.Close
wsk.Accept requestID
End Sub
Private Sub wsk_DataArrival(ByVal bytesTotal As Long)
Bytes = Bytes + bytesTotal
End Sub
Tengo el siguiente codigo que me permite hacer una grafica con los bytes que me llegan por el control winsock. en la cordenada de las y se puede ver los bytes y en la cordenada de las x el tiempo en segundos, pero no consigo que funcione haber si alguien me puede ayudar.
gracias
Option Explicit
Dim Bytes As Long
Dim x As Long
Dim lastx As Long
Dim lasty As Long
Private Sub Command1_Click()
wsk.LocalPort = 80
wsk.Listen
End Sub
Private Sub Command2_Click()
Picture1.Line (x, Text1)-(x + 1, Text1 + 1)
End Sub
Private Sub Form_Load()
x = 0
lastx = x
lasty = Picture1.Height
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
wsk.Close
End Sub
Private Sub Timer1_Timer()
Picture1.Line (lastx, lasty)-(x + 10, Picture1.Height - Bytes)
x = x + 10
If x >= Picture1.Width Then x = Picture1.Width
lastx = x
lasty = Picture1.Height - Bytes
Bytes = 0
End Sub
Private Sub wsk_ConnectionRequest(ByVal requestID As Long)
wsk.Close
wsk.Accept requestID
End Sub
Private Sub wsk_DataArrival(ByVal bytesTotal As Long)
Bytes = Bytes + bytesTotal
End Sub
Valora esta pregunta


0