Having Trouble getting URL's to update JPG image!
Sub main()
facade = CreateObject("roImageCanvas")
facade.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"}) 'Set opaque background
facade.Show()
m.canvas = CreateObject("roImageCanvas")
m.port = CreateObject("roMessagePort")
m.canvas.SetMessagePort(m.port)
m.canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"}) 'Set opaque background
showImageCanvas()
while(true)
msg = wait(0,m.port)
if type(msg) = "roImageCanvasEvent" then
if (msg.isRemoteKeyPressed()) then
i = msg.GetIndex()
print "Key Pressed - " ; msg.GetIndex()
if (i = 2) then
' Up - Close the screen.
m.canvas.close()
m.port = invalid
print "Closed"
facade.close()
return
end if
if (i = 3) then
print "Refreshing..."
m.canvas.close()
m.canvas = CreateObject("roImageCanvas")
m.canvas.SetMessagePort(m.port)
m.canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"}) 'Set opaque background
showImageCanvas()
end if
end if
end if
end while
End Sub
Sub showImageCanvas()
date = CreateObject("roDateTime")
print "The date is now "; date.AsSeconds()
canvasItems = [
{
url:"http://192.168.1.12:82/SnapShot/cam1.jpg"
TargetRect:{x:0,y:20,w:640,h:340} '0,0 ~ 640,360 upper left
CompositionMode:"Source"
},
{
url:"http://192.168.1.12:82/SnapShot/cam2.jpg"
TargetRect:{x:0,y:380,w:640,h:340} '0,360 ~ 640,360 lower left
CompositionMode:"Source"
},
{
url:"http://192.168.1.12:82/SnapShot/cam0.jpg"
TargetRect:{x:640,y:20,w:640,h:340} '640,0 ~ 640,360 upper right
CompositionMode:"Source"
},
{
url:"http://192.168.1.12:82/SnapShot/cam3.jpg"
TargetRect:{x:640,y:380,w:640,h:340} '640,360 ~ 640,360 lower right
CompositionMode:"Source"
},
{
'upper left
Text:"FRONT LEFT"
TextAttrs:{Color:"#FFFFFFFF", Font:"Small",HAlign:"Left", VAlign:"Center",Direction:"LeftToRight"}
TargetRect:{x:0,y:2,w:640,h:20}
CompositionMode:"Source"
},
{
'upper left
Text:date.AsSeconds()
TextAttrs:{Color:"#FFFFFFFF", Font:"Small",HAlign:"Right", VAlign:"Center",Direction:"LeftToRight"}
TargetRect:{x:320,y:2,w:320,h:20}
CompositionMode:"Source"
},
{
'lower left
Text:"FRONT CENTER"
TextAttrs:{Color:"#FFFFFFFF",Font:"Small",HAlign:"Left", VAlign:"Center",Direction:"LeftToRight"}
TargetRect:{x:0,y:362,w:640,h:20}
CompositionMode:"Source"
},
{
'upper right
Text:"FRONT RIGHT"
TextAttrs:{Color:"#FFFFFFFF", Font:"Small",HAlign:"Left", VAlign:"Center",Direction:"LeftToRight"}
TargetRect:{x:640,y:2,w:640,h:20}
CompositionMode:"Source"
},
{
'lower right
Text:"REAR VIEW"
TextAttrs:{Color:"#FFFFFFFF",Font:"Small",HAlign:"Left", VAlign:"Center",Direction:"LeftToRight"}
TargetRect:{x:640,y:362,w:640,h:20}
CompositionMode:"Source"
}
]
m.canvas.SetRequireAllImagesToDraw(true)
m.canvas.SetLayer(1, canvasItems)
m.canvas.Show()
m.canvas.PurgeCachedImages()
canvasItems.clear()
End Sub
Images on Website are constantly updated by DVR (i.e. GeoVision) using FTP to a folder under IIS. Therefore every .1 sec a new image is written.
When I reload the roImageCanvas I don't get the updated JPG Images.
Any help would be nice!
Thanks