I want to display a webcam image that gets uploaded to a server, that is say 600px wide, but I want it to display in a box that is only 100px wide. I already use iFrame for a similar task, but the resizing won’t work in iFrame. Any suggestions?
Hi David,
I have a link hallislake.ca (this is a cross country ski club in British Columbia, Canada) just setting up their PC. The larger photo will display an exterior shot, with a smaller picture displaying a thermometer on a separate camera.
I have a website myself using evocam (barkervilleweather.ca) and they wanted a similar setup, but didn’t know how to resize the picture.
If you’re using an iframe, you can use the CSS3 Transform styling hook to resize the iframe and its contents. This only works in IE9 and up, or any normal browser. It’s not trivial to get right, because the percentage applies to some, but not all of the attributes of the iframe – you have to fiddle with margins, otherwise the outer box (reserved space) on the page will be the original size of the iframe.
Transform styling hooks sounds interesting - new to me. How would I use it? Put in an html code in the url window… something like ? I am not that familiar with code so I would need guidance.
If you want the image to update while the page is open, you can add a JavaScript to do this. If you only want the image to load once, and then stay wherever it was when the page initially loaded, then you are all done. Just make an image box on the page, change the Type picker in the Inspector to URL, and paste in this URL there. In the Item / Extended interface, add the height and width that you want the image to appear. The resulting code will look like this (in HTML):
Select Item > Extended and with the tab selected click Add and enter;
name: width
value: 200px
(or whatever image width you want)
This last step will tell the browser to render the image at your given size rather than at the original size or 640 pixels wide. Sadly you can’t just drag the HTML box to the size you want it.
I want to display a webcam image that gets uploaded to a server, that is say 600px wide, but I want it to display in a box that is only 100px wide. I already use iFrame for a similar task, but the resizing won’t work in iFrame. Any suggestions?
Hi Tim and Walt, thanks for clear instructions. Both work for me. I want to stay away from java script as it has caused problems for viewers. I use autorefresh on the barkervilleweather.ca site, but safari “remembers” the cached jpg and stubbornly won’t refresh. I have resorted to a link directly to the jpg file for viewers that have problems, and will probably have the same issue with the ski site. I don’t have the skills to fix it. But I am happy that this works now.
Hi Eva,
If you change your mind the JavaScript code I mentioned in that thread appends a timestamp to the webcam image reference so the browser won’t cache it. The browser should see each updated image as a new image reference and reload it from the source file.
Regards,
Tim.
On 24 Mar 2014, at 20:34, Eva Grandell wrote:
I want to stay away from java script as it has caused problems for viewers. I use autorefresh on the barkervilleweather.ca site, but safari “remembers” the cached jpg and stubbornly won’t refresh. I have resorted to a link directly to the jpg file for viewers that have problems, and will probably have the same issue with the ski site.
You don’t appear to have misgivings about using it on the barkerville site - rollovers, Google Analytics etc. etc. all use it as do most of the other FW actions.
You are more likely to get a reliable refresh with Tim’s code.
That’s because I didn’t realize they were js. I use Freeway so I don’t have to use code : ) - however, I am open to suggestions and will and try Tim’s code (not today though) but will let you know how it works. The ski webcam uploads via a PC and Tincam and I am not familiar with that software, I’m not the operator, so I don’t expect it’s as flexible as evocam.
Thanks for all help guys, it’s awesome support!
I should let you know that I did indeed change the barkervilleweather.ca site to Tim’s javascript code, and it’s been running without a glitch since end of March. Yay!