Forum Discussion

richwhite's avatar
richwhite
Visitor
12 years ago

Loop Image in Channel ... any roImageCanvas examples ?

I have created a Roku Channel, have the SDK, and have looped over all of the examples but I am not finding what Im looking for.

Here is what I have:
* I have a WiFi field cam that will FTP's an image to a web server every 30 seconds.

What I want to do:
* Create an app for my channel that will grab the image from the web server & display that image to the screen, then refresh every 31 seconds.

... This should be an incredibly easy app but I am finding almost no resources to get started.
... So far the document here has been the most useful - http://sdkdocs.roku.com/display/sdkdoc/roImageCanvas .. but I see no looping ... to avoid haveing to clear the cache each time I assumed this would work for the image

url:"http://myServer/myImage.jpg?r="+rnd(3000).tostr()

I just need to loop it given the example at http://sdkdocs.roku.com/display/sdkdoc/roImageCanvas

... ANy thoughs ?

3 Replies

  • Well I don't think there are any examples that do this but it's not very hard. Use an roTimespan as a timer to determine when it's time to switch to a new image. Change your wait call in your event loop to have a nonzero timeout. When it's time to update the image, modify the URL in your content metadata and call SetLayer again.

    --Mark