Cartoon strip webcam...

W

WPKenny

Guest
Hi,
I was wondering if someone could help me out by coding a simple page for me? I'll cut and paste the existing one at the end of this post.

For those of you who've got/used Webcam32 I want to emulate the "Previous Frames" feature so it shows like a cartoon strip.

The picture filename is wpkenny.jpg and I'd like the code to rename the file to wpkenny2.jpg and increment it until something like wpkenny5.jpg and then delete it.

So I've got five pics on the go like some sort of camera cartoon strip.

Erm. I hope I've explained myself just enough to be understood. Anyway..here's the existing page...

<html>
<head>
<title>WPKenny cam</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="javascript">
<!--

var x = 5
function StartClock(){
document.form1.clock.value = x
timerID = setTimeout("StartClock()", 1000)
x = x-1
if (x==0){
location.reload();
}
}


//-->
</SCRIPT>
</head>

<body bgcolor="#C68E4A" text="#9674C8" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="StartClock()">
<div align="center">
<center>
<table border="0" width="100" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle">
wpkenny.jpg
</td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" width="321" cellspacing="0" cellpadding="0" bgcolor="#007518">
<tr>
<td align="center" bgcolor="#008000" width="319">
<FORM NAME="form1">
<font face="Arial" color="#000000" size="3">
Refreshing in <INPUT TYPE="text" SIZE="2" NAME="clock">
seconds</font>
</FORM></td>
</tr>
</table>
</center>
</div>
</body>
</html>
 
S

ShockingAlberto

Guest
Hmm, you can't create enw images using javascript, as it's a client side thing, however, i think you could do something like:

Code:
<SCRIPT LANGUAGE="javascript">
<!--
var x = 1
image= new Image(320,240)
image.src = "wpkenny.jpg"
function StartSlide(){
    timerID = setTimeout("StartSlide()", 5000)
    if (x==2)
       { document.image2.src= "wpkenny.jpg" }
    if (x==3)
       { document.image3.src= "wpkenny.jpg" }
    if (x==4)
       { document.image4.src= "wpkenny.jpg" }
    if (x==5)
       { document.image5.src= "wpkenny.jpg" }
    if (x==6)
       {  location.reload() }
    x = x+1
}
//-->
</SCRIPT>
If the image isn't cached, that might work, if not you could try using the 'new image()' thing for each one, which i put at the top for some unknown reason. Besides that, you'd have to look for an image refresh function. I don't like Javascript, and i don't know much, but that looks like it should work. Changes you would make to the rest of it:
* make 5 images, name them imageX, make all of them apart from image1 be some unimportant image such as a black gif, and change the onLoad event. Btw, i nicked your webcam refresh javascript a couple of weeks ago for my own webcam page :)
 
W

WPKenny

Guest
Ah Cheers! I forgot I'd posted in here!

I'll have a proper look at it when I get home tonight. Thnx.
 

Users who are viewing this thread

Top Bottom