WarrenW
May 7th, 2003, 08:32 AM
The following is a pull image script used with webcam32. I want to write my own app to return an image each time it is requested but I cannot figure out the way it requests an image. I have a web server control in VB and I can load any pages or images. I tried that when it requests just pull I return an image but its broken and stops. Can someone who knows about this tell me what way I need to return an image?
Thanks!
<html>
<head>
<title>Image Pull</title>
</head>
<body>
<H1>This is the client pull sample</H1>
<TABLE border=1 cellPadding=1 cellSpacing=1 width="75%">
<TR>
<TD height=300 style="BACKGROUND-COLOR: lightyellow; HEIGHT: 300px; WIDTH: 300px" width=300
align=middle vAlign=center>
<script LANGUAGE="JavaScript">
<!--
browserType = navigator.appName;
newImage = new Image();
document.onstop = document_onstop;
function startstop_onclick()
{
if (startstop.value == "Stop")
{
stopLoad();
}
else
{
startstop.value = "Stop";
newImage.onload=loadNewImage;
loadNewImage();
}
}
function document_onstop()
{
stopLoad();
}
function stopLoad()
{
newImage.onload="";
startstop.value = "Start";
window.status = "Live video stopped ...";
}
function loadNewImage()
{
uniq = new Date();
uniq = uniq.getTime();
document.images.webcam32.src=newImage.src;
newImage.src="http://127.0.0.1/pull?"+uniq;
window.status = "Displaying live video ...";
}
function initialImage()
{
uniq = new Date();
uniq = uniq.getTime();
newImage.onload=loadNewImage;
newImage.src="http://127.0.0.1/pull?"+uniq;
document.images.webcam32.onload="";
}
if (browserType == "Netscape")
{
document.write('<IMG SRC="http://127.0.0.1/push" width=160 height=120>');
}
else
{
document.write('<IMG SRC="http://127.0.0.1/pull" name=webcam32 onload="initialImage()" width=160 height=120>');
}
//-->
</script>
<P></P>
<P><INPUT id=startstop type=button value="Stop" LANGUAGE=javascript onclick="return startstop_onclick()"></P></TD></TR></TABLE>
</body>
</html>
Thanks!
<html>
<head>
<title>Image Pull</title>
</head>
<body>
<H1>This is the client pull sample</H1>
<TABLE border=1 cellPadding=1 cellSpacing=1 width="75%">
<TR>
<TD height=300 style="BACKGROUND-COLOR: lightyellow; HEIGHT: 300px; WIDTH: 300px" width=300
align=middle vAlign=center>
<script LANGUAGE="JavaScript">
<!--
browserType = navigator.appName;
newImage = new Image();
document.onstop = document_onstop;
function startstop_onclick()
{
if (startstop.value == "Stop")
{
stopLoad();
}
else
{
startstop.value = "Stop";
newImage.onload=loadNewImage;
loadNewImage();
}
}
function document_onstop()
{
stopLoad();
}
function stopLoad()
{
newImage.onload="";
startstop.value = "Start";
window.status = "Live video stopped ...";
}
function loadNewImage()
{
uniq = new Date();
uniq = uniq.getTime();
document.images.webcam32.src=newImage.src;
newImage.src="http://127.0.0.1/pull?"+uniq;
window.status = "Displaying live video ...";
}
function initialImage()
{
uniq = new Date();
uniq = uniq.getTime();
newImage.onload=loadNewImage;
newImage.src="http://127.0.0.1/pull?"+uniq;
document.images.webcam32.onload="";
}
if (browserType == "Netscape")
{
document.write('<IMG SRC="http://127.0.0.1/push" width=160 height=120>');
}
else
{
document.write('<IMG SRC="http://127.0.0.1/pull" name=webcam32 onload="initialImage()" width=160 height=120>');
}
//-->
</script>
<P></P>
<P><INPUT id=startstop type=button value="Stop" LANGUAGE=javascript onclick="return startstop_onclick()"></P></TD></TR></TABLE>
</body>
</html>