2012年2月20日月曜日

画像を切れ目なく動画のように更新する

Java Live Camera Sample


<html>
<head>
<title>Java Live Camera Sample</TITLE>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=Shift_JIS">
<script LANGUAGE="JavaScript">
  <!--
  function RefreshImg()
  {
      uniq = new Date();
      uniq = "?"+uniq.getTime();
      newImage = document.imgToLoad.src;
      index = newImage.indexOf("?", 0);
      if (index > 0)
          {
              newImage = newImage.substr(0, index);
          }
      document.imgToLoad.src = "http://192.168.24.53/cgi/cgiDspGetShot2"+uniq;
  }
  // -->
 </SCRIPT>
</HEAD>
<body>
<center>
<img SRC="http://192.168.24.53/cgi/cgiDspGetShot2" ALT="LiveCamera" name=imgToLoad
 onload='setTimeout("RefreshImg()", 1000)'
 onerror='setTimeout("RefreshImg()", 5000)'
 onabort='setTimeout("RefreshImg()", 1000)'
 id=imgToLoad naturalsizeflag=0>
</CENTER>
</BODY>
</HTML>