I’m grabbing some images from a URL and displaying them on a roImageCanvas, but when I grab the updated image with the same url the screen doesn’t display the fresh image. All I’ve seen in the docs is the PurgeCachedImages() method, but I’m not able toget that to work. I’m using the CustomVideoPlayer as the structure of the channel and I’m displaying the images in the following code snippet.
m.canvas.AllowUpdates(false)
m.canvas.Clear()
m.canvas.purgecachedimages()
m.canvas.SetLayer(0, [
{ url: "http://my.images.com/image?ID_NOTATION=324977&HEIGHT=75&WIDTH=120&TIME_SPAN=1"
TargetRect: m.layout.image1
'CompositionMode: "Source_Over"
},
more images here etc
What’s the solution to purge the images so new ones will display?
TIA
Mark
Images are cached based on the URL, so if you want to force an update, the easiest way is to add a random value to the querystring, so the URL changes.
Pseudo-example…
date = CreateObject("roDateTime")
...
url: "http://my.images.com/image?ID_NOTATION=324977&HEIGHT=75&WIDTH=120&TIME_SPAN=1&nocache=" + date.AsSeconds().ToStr()
PurgeCachedImages: This is a convenience method that will purge the internal cache of all images related to urls in the current content list. If the content list is empty, then this method will do nothing.