473,661 Members | 2,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.getEle mentById('camer a').src = 'http://192.168.1.34/jpg/image.jpg';
timerID = setTimeout("cam era",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(O bject source, System.Timers.E lapsedEventArgs e)
{
WebClient Client = new WebClient();
byte[] image =
Client.Download Data("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 2062
the browser caches images. just decorate url with client: script:

var jid=0;
function mycamera() {
document.getEle mentById('camer a').src =
'http://192.168.1.34/jpg/image.jpg?jid=' + (jid++);
timerID = setTimeout("cam era",1000);
}

-- bruce (sqlwork.com)
"Alan" <Al**@discussio ns.microsoft.co m> wrote in message
news:CF******** *************** ***********@mic rosoft.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.getEle mentById('camer a').src =
'http://192.168.1.34/jpg/image.jpg';
timerID = setTimeout("cam era",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(O bject source, System.Timers.E lapsedEventArgs
e)
{
WebClient Client = new WebClient();
byte[] image =
Client.Download Data("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 "Downloadin g 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.getEle mentById('camer a').src =
'http://192.168.1.34/jpg/image.jpg?jid=' + (jid++);
timerID = setTimeout("cam era",1000);
}

-- bruce (sqlwork.com)
"Alan" <Al**@discussio ns.microsoft.co m> wrote in message
news:CF******** *************** ***********@mic rosoft.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.getEle mentById('camer a').src =
'http://192.168.1.34/jpg/image.jpg';
timerID = setTimeout("cam era",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(O bject source, System.Timers.E lapsedEventArgs
e)
{
WebClient Client = new WebClient();
byte[] image =
Client.Download Data("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
8225
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 Delphi program, but I have problems reading the pics from the socket's stream. Here's my code:
4
4366
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 fils. Is there seperate way to open jpegs etc and buffer them and send them.
0
3596
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 into byte from a stream. Exception (System.ArgumentException: Invalid parameter used) occurs when reading from byte over a memory-stream back to the Bitmap object. Please help, I'm really stuck here! Here's the code I use (Sorry for a long...
3
1447
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 thanks in advance, --prem
6
2291
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 the middle of everything: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
0
1457
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 resource file. Then I need to be able to open the resource file and read the individual jpeg or bmp file from there. I may need to do other format files as well if this all works. 1: What memory structure would I read the files in to? and how...
14
5222
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
5118
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
3060
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 whole file and split it, because it would cost 2GB memory. Can anyone help me? Any comments would be appreciated. Thanks.
2
2250
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 RGB color model jpeg..if anyone can give feedback (esp on the methods writeImage1( ) and writeImage2( ) it wd help my studies .. TIA dn
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8754
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.