Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
eockh
Visitor

roImageCanvas not closing

I have the following navigation stack in my channel: (roGridScreen -> roScreen -> roImageCanvas)

When I exit the roImageCanvas screen I call (close()) and set the reference to invalid. However when I exit the roScreen, the channel displays the roImageCanvas for a moment before displaying the roGridScreen. I have also tried the following code in an effort to at least clear the screen to black and I still get the artifacting:

canvas.allowupdates(true)
canvas.purgecachedimages()
canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"})
canvas.SetLayer(1, {Color:"#FF000000", CompositionMode:"Source"})
canvas.show()
canvas.close()
canvas = invalid

Any ideas why the image canvas is not destroyed?
0 Kudos
2 REPLIES 2
TheEndless
Channel Surfer

Re: roImageCanvas not closing

Try adding a short Sleep() immediately after closing the canvas. Show and Close aren't synchronous, so it may be that the canvas doesn't have sufficient time to close before you open the roScreen. It could also be an anomaly with roScreen that's related to this statement in the SDK documentation:
"http wrote:
Once an roScreen is created, the display stack enters "Game Mode", and other screen components cannot be used. Other screen components cannot be intermixed with roScreens as the roScreen display stack is maintained independently from the main screen component display stack.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
eockh
Visitor

Re: roImageCanvas not closing

The sleep was it..... Sleep(50) seemed to be sufficient. Thanks!
0 Kudos