Skip to content Skip to sidebar Skip to footer

Kivy Refresh Image

I have an an image (kivy.uix.image.Image) instantiated with a source, but I change the source file's data. How can I refresh the image to reflect the new data?

Solution 1:

Hard case, since the filename is used as key for caching. You can clear all the cache, before changing the source:

from kivy.cache import Cache
Cache.remove('kv.image')
Cache.remove('kv.texture')
# then change the source of the image

It should be ok, but not efficient.

As qua-non said:

Also if you can use the development branch or wait for the 1.3 release. You can use the following functions to achieve just that ::

For the Image widget Image.reload()

For the Core Image Image.remove_from_cache()

Post a Comment for "Kivy Refresh Image"