473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

read jpeg

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
2 2049
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jan Schatz | last post by:
Hi, I have an application sending JPEGs via a TCP connection. By now I used a Delphi program on the other side to receive the pics. Now I want to create a Java applet that does the work of the...
4
by: sree | last post by:
i am doing project a simple http server. it is being writen in c using sockets. so when there is a request to read a jpeg or any other file icant do it. my code is working only for html and txt...
0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
3
by: prem | last post by:
Hi all, I want to read the colors used in a jpeg image. I want the code or any any other code components that can do that. any suggestion , links and samples will be gratly appreciated ...
6
by: Klaus Jensen | last post by:
Hi I have some binary files (jpeg), which contain a lot of image-data - and some embedded XML (XMP actually). If I view the file in a hex-editor, there is a lot of binary data - and then in...
0
by: brendon | last post by:
I need to read in a jpeg or bmp file in to memory and then save these files in to a resource file for distribution in a form other than jpeg or bmp. This requires only one file to be distributed, the...
14
by: Frank | last post by:
I see that ImageFormat includes exif. But I can't find out if I've System.Drawing.Image.FromStream or something like it can read and/or write that format.
12
by: Speed | last post by:
Hi, Could you please tell me what is the simplest code to read a 8-bit grayscale JPEG using C++? Thanks a ton, Speed.
4
by: Pacino | last post by:
Hi, everyone, I am wondering whether it's possible to read part (e.g. 1000*1000) of a huge jpeg file (e.g. 30000*30000) and save it to another jpeg file by pure python. I failed to read the...
2
by: devnew | last post by:
hi i am new to python and PIL and was trying to write a class to read and write RGB color model jpeg images.. i came up with this class below..i want to know if this is the way to read/write the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.