HI,
I want to replace images in roImageCanvas one after another (to show overlay over static map as weather report ). Is there any way to show replaced image in fast way? I am using the following code to achieve this:
function main()
m.mapCanvas = createObject(“roImageCanvas”)
mapPort = CreateObject(“roMessagePort”)
m.mapCanvas.SetMessagePort(mapPort)
m.mapCanvas.SetRequireAllImagesToDraw(false)
m.mapCanvas.PurgeCachedImages()
m.mapCanvas.AllowUpdates(false)
list =
list.push({Color:“#b2cffb”, CompositionMode:“Source”})
m.mapCanvas.setLayer(0, list)
m.mapCanvas.AllowUpdates(true)
m.mapCanvas.show()
while true
msg = wait(2500, mapPort)
if(type(msg) = “roImageCanvasEvent”)
if(msg.isRemoteKeyPressed())
print “Remote Event called.”
else if(msg.isScreenClosed())
print “Screen Closed Event called.”
end if
else
showOverlay()
end if
end while
end function
Function showOverlay()
m.mapCanvas.AllowUpdates(false)
list =
overlayURL = Different_Overlay_Url_Comes_Here_Every_Time
list.Push({
url: overlayURL
TargetRect:{x:0, y:0, w:1280, h:720}
})
m.mapCanvas.SetLayer(1, list)
m.mapCanvas.AllowUpdates(true)
End Function
If i am reducing the wait duration then it never received the “roImageCanvasEvent” and also the Image not successfully draw on the canvas.
Is there any way to achieve this in proper way? or should I use some other component to achieve this.
Please give me any short example if any.
Thanks for reply in advance.
