By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

read jpeg

P: n/a
Hello,
I am making a web page where I need to show somewhere in the page a webcam
without component like activex.
In my webcam I can read the last picture with the following command:
http://192.168.1.34/jpg/image.jpg
I have a img tag in my web page where I show the last picture. But I don't
want to refresh the web page all the time to show my webcam and for that I
made a javascript that read the picture:
function mycamera() {
document.getElementById('camera').src = 'http://192.168.1.34/jpg/image.jpg';
timerID = setTimeout("camera",1000);
}
But the behavior is not the same than when I refresh the page, because it
show me always the same picture, but if in another web page I read the webcam
picture (with a refresh of the page) in the first web page I have the new
picture.
I think the webcam generate a new picture with a http request, and I try to
do a function in the web server wich read cyclic the picture:
public void RefreshCamera(Object source, System.Timers.ElapsedEventArgs e)
{
WebClient Client = new WebClient();
byte[] image =
Client.DownloadData("http://192.168.1.34/jpg/image.jpg");
aTimer.Start();
}
but the webcam do not generate a new picture.

Thanks for your help.

Mar 15 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
the browser caches images. just decorate url with client: script:

var jid=0;
function mycamera() {
document.getElementById('camera').src =
'http://192.168.1.34/jpg/image.jpg?jid=' + (jid++);
timerID = setTimeout("camera",1000);
}

-- bruce (sqlwork.com)
"Alan" <Al**@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
Hello,
I am making a web page where I need to show somewhere in the page a webcam
without component like activex.
In my webcam I can read the last picture with the following command:
http://192.168.1.34/jpg/image.jpg
I have a img tag in my web page where I show the last picture. But I don't
want to refresh the web page all the time to show my webcam and for that I
made a javascript that read the picture:
function mycamera() {
document.getElementById('camera').src =
'http://192.168.1.34/jpg/image.jpg';
timerID = setTimeout("camera",1000);
}
But the behavior is not the same than when I refresh the page, because it
show me always the same picture, but if in another web page I read the
webcam
picture (with a refresh of the page) in the first web page I have the new
picture.
I think the webcam generate a new picture with a http request, and I try
to
do a function in the web server wich read cyclic the picture:
public void RefreshCamera(Object source, System.Timers.ElapsedEventArgs
e)
{
WebClient Client = new WebClient();
byte[] image =
Client.DownloadData("http://192.168.1.34/jpg/image.jpg");
aTimer.Start();
}
but the webcam do not generate a new picture.

Thanks for your help.

Mar 15 '06 #2

P: n/a
Thank, your solution work properly.
But there is alway the message "Downloading picture http://...... and the
mouse with the sand glass, is there a method to hide this message.

"Bruce Barker" wrote:
the browser caches images. just decorate url with client: script:

var jid=0;
function mycamera() {
document.getElementById('camera').src =
'http://192.168.1.34/jpg/image.jpg?jid=' + (jid++);
timerID = setTimeout("camera",1000);
}

-- bruce (sqlwork.com)
"Alan" <Al**@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
Hello,
I am making a web page where I need to show somewhere in the page a webcam
without component like activex.
In my webcam I can read the last picture with the following command:
http://192.168.1.34/jpg/image.jpg
I have a img tag in my web page where I show the last picture. But I don't
want to refresh the web page all the time to show my webcam and for that I
made a javascript that read the picture:
function mycamera() {
document.getElementById('camera').src =
'http://192.168.1.34/jpg/image.jpg';
timerID = setTimeout("camera",1000);
}
But the behavior is not the same than when I refresh the page, because it
show me always the same picture, but if in another web page I read the
webcam
picture (with a refresh of the page) in the first web page I have the new
picture.
I think the webcam generate a new picture with a http request, and I try
to
do a function in the web server wich read cyclic the picture:
public void RefreshCamera(Object source, System.Timers.ElapsedEventArgs
e)
{
WebClient Client = new WebClient();
byte[] image =
Client.DownloadData("http://192.168.1.34/jpg/image.jpg");
aTimer.Start();
}
but the webcam do not generate a new picture.

Thanks for your help.


Mar 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.