def update_2(self):
if self.running == False:
return
# Read the length of the image as a 32-bit unsigned int.
data_len = struct.unpack('<L', self.connection.read(struct.calcsize('<L')))[0]
if data_len:
printD('Updating...')
printD('data_len: %s' % data_len)
data = self.connection.read(data_len)
deserialized_data = msgpack.unpackb(data, object_hook=msgpack_numpy.decode)
printD('Frame received')
#print(deserialized_data)
#stdout.flush()
img = Image.fromarray(deserialized_data)
newImage = ImageTk.PhotoImage(img)
self.gui.stream_label.configure(image=newImage)
self.gui.stream_label.image = newImage
self.gui.master.after(70, self.update_2)
评论列表
文章目录