codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Image array - webcam display  migz at 06:21 on Friday, May 01, 2009
 

Hi guys,

I'm having some trouble executing my script and I'm not sure where I am going wrong.

It for a webcam - The web cam captures 5 images a second and is saved into a directory, (only 5 images) and the 5 images gets over written every 1 second.

The script needs to read in sequential order 1-2-3-4-5 and loop back, refreshing the images.

I hope someone can help.... Thanks in advanced.

----------------------------

<html>
<head>
<script type="text/javascript">
var mypics = new Array(); //making a new array
mypics [0] = "http://localhost/cam2images/snap.jpg"; //storing dead paths
mypics [1] = "http://localhost/cam2images/snap1.jpg";
mypics [2] = "http://localhost/cam2images/snap2.jpg";
mypics [3] = "http://localhost/cam2images/snap3.jpg";
mypics [4] = "http://localhost/cam2images/snap4.jpg";

<!--
function refreshImage()
{
var img = document.getElementById('idofyourimage');

i=integer; //integer value...

for (i=0;i<5;i++) // makes it loop through array with pointer of i;
{

img.src=mypic;

}

setTimeout("refreshImage()", 4000);
}
//-->
</script>
</head>
<body>
<img src="/forum/cam2images/snap.jpg" id="idofyourimage" width="600" height="480" />


<script type="text/javascript">

<!--

setTimeout("refreshImage()",1000);

//-->

</script>

</body>

</html>









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Help with Form--onClick won`t run function
•  NaN
•  accessing oleVariant type of activeX component written in delphi
•  Image array - webcam display
•  Multiple onload not working?
•  Hi,i m a new guy learing c++, here is the thing...please help me out...
•  Re: read lines from a file
•  Re: C++ Inheritance Polymorphism
•  Re: getting an object`s property which is decided by content of variable.


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009