Ti posto il codice che ho utilizzato:
‘’’’ LATO CLIENT ‘’’’
Private Sub InviaDesktop()
If teleassistenza = True And SockMain.State = sckConnected Then
‘ posiziona il cursore in base alle coordinate ricevute
SetCursorPos Val(Text1.Text), Val(Text2.Text)
On Error Resume Next
‘ esegue il print dello schermo
PrintScreen (False)
‘carica l’immagine nel controllo picture
Picture1.Picture = Clipboard.GetData(vbCFBitmap)
GetObject Picture1.Picture, Len(PicInfo), PicInfo
BytesPerLine = (PicInfo.bmWidth * 3 + 3) And &HFFFFFFFC
'questo array (picbits) è molto grande
' dell'ordine PicBits(7000000) as byte
ReDim PicBits(1 To BytesPerLine * PicInfo.bmHeight * 3) As Byte
'Copia i bit dell’immagine in un array
GetBitmapBits Picture1.Image, UBound(PicBits), PicBits(1)
‘ invia l’array di bits
SockTele.SendData (PicBits)
DoEvents
End If
End Sub
‘’’’ LATO SERVER ‘’’’
Private Sub SockMain_DataArrival(ByVal bytesTotal As Long)
Dim dati As String
SockMain.GetData dati
If dati = "disconnetti" Then
txtLog.Text = txtLog.Text & "@ DISCONNESSIONE @ {HOST: " & SockMain.RemoteHostIP & " - PORTA: " & SockMain.RemotePort & "}" & vbCrLf
Else
‘ recupera i bits dell’array inviato dal client e li imposta nel controllo picture
SetBitmapBits Picture1.Image, UBound(dati), dati(1)
Refresh
Picture1.Refresh
End If
End sub
Grazie ancora una volta del tempo che mi dedichi!
Ultima modifica effettuata da roberto82 il 02/09/2008 alle 19:51 |