Announcement
Collapse
No announcement yet.
Need help with code to send image
Collapse
This topic is closed.
X
X
-
cyvinec
Jim,
Here you go you will need to change the web server port and enter the client name if you want.
PHP Code:Sub Main()
dim LastImageName
dim serverport: serverport = 88
dim client: client = ""
LastImageName = hs.GetIniSetting("Thumbs", "LastImageName", "", "hspi_Hauppauge_Capture.ini")
'LastImageName = "c:\program files\homeseer\html\images\motionchart.gif"
LastImageName = Replace(LastImageName,"c:\program files\homeseer\html\","%HS_SERVER%:" & serverport & "\")
hs.Plugin("Message Server").MessageToClient "<img border='0' src='http://" & LastImageName & "'>",,0,1,0,client
End Sub
Christian
-
HTTP://c:\progran files\homeseer\html\capture\driveway\*.jpg". The replace function dose not seem to be doing anything. What am I doing wrong?
Thanks
Jim
Comment
-
cyvinec
-
cyvinec
You can try this replace line I added all the optional parameter.
Code:LastImageName = Replace(LastImageName,"c:\program files\homeseer\html\","%HS_SERVER%:" & serverport & "\", 1, -1, vbTextCompare)
Code:dim strTemp: strTemp = "112233" strTemp = replace(strTemp,"1","33",1,-1,vbTextCompare) strTemp = replace(strTemp,"2","33",1,-1,vbTextCompare) hs.writelog "debug",strTemp
Regards,
Christian
Comment
-
Thanks for putting up with my questions. The last line worked great. I do have one more question if it not to much trouble. If I wanted to give the message box a title that was a variable what would be the proper way?
Title=?
hs.Plugin("Message Server").MessageToClient "<img border='0' src='http://" & LastImageName & "'>","??????????",0,1,0,client
Thanks
Jim
Comment
-
cyvinec
Jim,
What Windows version are you running? I knew I should not let optional variable empty but I wanted to keep it short. Too short I guess.
For the title on top of your script add.
PHP Code:dim Title
Title = "Your script title"
PHP Code:hs.Plugin("Message Server").MessageToClient "<img border='0' src='http://" & LastImageName & "'>",Title,0,1,0,client
Christian
Comment
Comment