rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.48k stars 401 forks source link

How to dynamically change(reload) image object? #443

Closed occoder closed 3 years ago

occoder commented 3 years ago

Once the Image object is packed into container and initialized with the container after web server starting up, the image resource is reloaded through a Timer thread code like

def check_status(self, update_interval):
    with self.update_lock:
        self.img_xxx.set_image(gui.load_resource('./res/yyy.png'))
    Timer(update_interval, self.check_status, (update_interval,)).start()

But the image shown on the web page does not change accordingly. Then what is the proper way to dynamically change(reload) such image? Thanks in advance.

occoder commented 3 years ago

I figured it out. It's working now.