Announcement

Collapse
No announcement yet.

Need help with code to send image

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need help with code to send image


    #2
    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 
    Regards,
    Christian

    Comment


      #3
      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


        #4

        Comment


          #5

          Comment


            #6
            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)
            If it still not works I would make sure the replace function work with this little script.
            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
            This should log "333333" it's so simple I don't know where to look.

            Regards,
            Christian

            Comment


              #7
              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


                #8
                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" 
                Then the line to send the message will look like this
                PHP Code:
                hs.Plugin("Message Server").MessageToClient "<img border='0' src='http://" LastImageName "'>",Title,0,1,0,client 
                Regards,
                Christian

                Comment


                  #9
                  Thanks for you help every thing is working great, I am running Windows XP Pro SP2.

                  Thanks
                  Jim

                  Comment

                  Working...
                  X