Display Images

Discussion in 'ASP .Net' started by =?Utf-8?B?UWluZ2RvbmcgWi4=?=, May 20, 2004.

  1. I have a web page to work as Video Web Viewer. It pulls image from IP camera using JavaScript. It works great in most of time. When users are in slow network,

    the Internet Explore begins to display part of the image before the image is fully downloaded, so the video looks like broken sometimes.

    I remember that web Brower used to have an option <Show Picture after Downloaded>. I can not find it in Internet Explore settings. Your advices on JavaScript or

    Web Brower setting are high appreciated. I don't want to use Java in this page. Thanks

    Here is the sample code:

    <HTML><HEAD><SCRIPT language="Javascript"
    var imgURL = "http://ipaddress/image.aspx"
    function Image_onload() {
    document.xxxx.imgCamera.src = imgURL + '&' + (new Date().getTime());;

    </SCRIPT></HEAD><body
    ..
    <IMG name="imgCamera" onload="Image_onload();" src="http://ipaddress/image.aspx"></IMG
    ..
    </body><
     
    =?Utf-8?B?UWluZ2RvbmcgWi4=?=, May 20, 2004
    #1
    1. Advertising

  2. Hi

    The standard is doing it with JavaScript..

    function getImg(sSrc){
    var i = new Image();
    i.src = sSrc;
    i.onload = dispPic;
    i.onerror = errHandler;
    }

    function dispPic(){
    document.images["TARGET_IMG_NAME"].src = this.src;
    }

    function errHandler(){
    alert("Error getting image");
    }

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Scripting MVP
    http://www.microsoft.com/technet/scriptcenter
    ==============================
    "Qingdong Z." <> wrote in message
    news:...
    >I have a web page to work as Video Web Viewer. It pulls image from IP
    >camera using JavaScript. It works great in most of time. When users are in
    >slow network,
    >
    > the Internet Explore begins to display part of the image before the image
    > is fully downloaded, so the video looks like broken sometimes.
    >
    > I remember that web Brower used to have an option <Show Picture after
    > Downloaded>. I can not find it in Internet Explore settings. Your advices
    > on JavaScript or
    >
    > Web Brower setting are high appreciated. I don't want to use Java in this
    > page. Thanks.
    >
    > Here is the sample code:
    >
    > <HTML><HEAD><SCRIPT language="Javascript">
    > var imgURL = "http://ipaddress/image.aspx";
    > function Image_onload() {
    > document.xxxx.imgCamera.src = imgURL + '&' + (new Date().getTime());;
    > }
    > </SCRIPT></HEAD><body>
    > ...
    > <IMG name="imgCamera" onload="Image_onload();"
    > src="http://ipaddress/image.aspx"></IMG>
    > ...
    > </body><
     
    Vidar Petursson, May 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    4
    Views:
    921
    Eliyahu Goldin
    Jan 4, 2005
  2. Luis Esteban Valencia Muñoz
    Replies:
    0
    Views:
    795
    Luis Esteban Valencia Muñoz
    Jun 3, 2005
  3. wardemon

    Cache Images vs Static Images

    wardemon, Jun 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    677
    bruce barker
    Jun 14, 2007
  4. Keith Hughitt
    Replies:
    6
    Views:
    1,091
  5. Adrienne Boswell
    Replies:
    1
    Views:
    520
    dorayme
    Aug 4, 2009
Loading...

Share This Page