#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
UDPStartup()
While 1
$socket = UDPBind("192.168.1.103", 65532)
If @error <> 0 Then
Sleep(200)
Else
ExitLoop
EndIf
WEnd
While 1
$socket1 = UDPOpen("192.168.1.100", 65532)
If @error <> 0 Then
Sleep(200)
Else
ExitLoop
EndIf
WEnd
HotKeySet("{esc}","_Exit")
opt("GUIOnEventMode",1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 800, 600, -1, -1)
$Pic1 = GUICtrlCreatePic("", 0, 0, 800, 600, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
#EndRegion ### END Koda GUI section ###
While 1
$data = UDPRecv($socket, 90000)
If $data <> "" Then
$file = FileOpen("Temp.jpg", 18)
FileWrite($file, $data)
FileClose($file)
GUICtrlSetImage($Pic1,"Temp.jpg")
EndIf
Sleep(100)
rev()
WEnd
Func rev()
$send = UDPSend($socket1, 'sendpicpls')
EndFunc ;==>rev
Func _exit()
Exit
EndFunc改了一下“接受端”,可是像视频一样收看了。 这个是牛贴,一定要顶{:face (239):} 这个传输可以达到每秒中多少帧????如果帧数太少。。{:face (125):} 真高端啊!
页:
1
[2]