Click here to Skip to main content
15,910,471 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ask about UDP programming? Pin
Brillian Kharisma8-Mar-12 3:15
Brillian Kharisma8-Mar-12 3:15 
GeneralRe: ask about UDP programming? Pin
Wes Aday8-Mar-12 7:07
professionalWes Aday8-Mar-12 7:07 
AnswerRe: ask about UDP programming? Pin
Albert Holguin9-Mar-12 5:16
professionalAlbert Holguin9-Mar-12 5:16 
GeneralRe: ask about UDP programming? Pin
MagicBishop9-Mar-12 10:04
professionalMagicBishop9-Mar-12 10:04 
General3D Head modeling Pin
s.sanam7-Mar-12 21:58
s.sanam7-Mar-12 21:58 
GeneralRe: 3D Head modeling Pin
_AnsHUMAN_ 7-Mar-12 23:06
_AnsHUMAN_ 7-Mar-12 23:06 
GeneralRe: 3D Head modeling Pin
Maximilien8-Mar-12 0:29
Maximilien8-Mar-12 0:29 
QuestionTake and save the image from the Ip camera Pin
Synodiporos7-Mar-12 5:58
Synodiporos7-Mar-12 5:58 
Hello everyone!

I have a EasyN ip Camera and I want to take the picture as .Jpg. The url that displays the image in my browser is http://192.168.1.xxx:xx/videostream.cgi.
After many hours searching in the internet I found this interest tutorial Camera Vision - video surveillance on C#,
but because I do not know much about Visual Studio did not help me very much.
Specifically, I have created a Visual C # Console Application but when I try to debugging shows some errors like: "The type or name 'HttpWebRequest' could not be found (are you missing a using directive or an assembly reference?)".
What am I doing wrong and the program not works?

Initially, What I want is the picture is automatically saved in my hard disk as .Jpg format. How can this happen?

Here is my code
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            string sourceURL = "http://192.168.1.xxx:xx/videostream.cgi";
            byte[] buffer = new byte[100000];
            int read, total = 0;
            // create HTTP request
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sourceURL);
            // get response
            WebResponse resp = req.GetResponse();
            // get response stream
            Stream stream = resp.GetResponseStream();
            // read data from stream
            while ((read = stream.Read(buffer, total, 1000)) != 0)
            {
                total += read;
            }
            // get bitmap
            Bitmap bmp = (Bitmap)Bitmap.FromStream(
                          new MemoryStream(buffer, 0, total));
        }
    }
}

It would be valuable any of yours help!
Thank you!
AnswerRe: Take and save the image from the Ip camera Pin
Richard MacCutchan7-Mar-12 6:59
mveRichard MacCutchan7-Mar-12 6:59 
GeneralRe: Take and save the image from the Ip camera Pin
Synodiporos12-Mar-12 5:50
Synodiporos12-Mar-12 5:50 
GeneralRe: Take and save the image from the Ip camera Pin
Synodiporos12-Mar-12 6:01
Synodiporos12-Mar-12 6:01 
GeneralRe: Take and save the image from the Ip camera Pin
Richard MacCutchan12-Mar-12 6:17
mveRichard MacCutchan12-Mar-12 6:17 
GeneralRe: Take and save the image from the Ip camera Pin
Synodiporos14-Mar-12 3:20
Synodiporos14-Mar-12 3:20 
GeneralRe: Take and save the image from the Ip camera Pin
Synodiporos14-Mar-12 3:34
Synodiporos14-Mar-12 3:34 
GeneralRe: Take and save the image from the Ip camera Pin
Synodiporos15-Mar-12 7:57
Synodiporos15-Mar-12 7:57 
GeneralRe: Take and save the image from the Ip camera Pin
Richard MacCutchan15-Mar-12 8:29
mveRichard MacCutchan15-Mar-12 8:29 
GeneralRe: Take and save the image from the Ip camera Pin
Synodiporos21-Mar-12 23:31
Synodiporos21-Mar-12 23:31 
AnswerRe: Take and save the image from the Ip camera Pin
enhzflep7-Mar-12 7:19
enhzflep7-Mar-12 7:19 
QuestionHow to validate a socket descripter Pin
vikramlinux7-Mar-12 5:08
vikramlinux7-Mar-12 5:08 
QuestionRe: How to validate a socket descripter Pin
Richard MacCutchan7-Mar-12 5:12
mveRichard MacCutchan7-Mar-12 5:12 
AnswerRe: How to validate a socket descripter Pin
vikramlinux7-Mar-12 5:15
vikramlinux7-Mar-12 5:15 
AnswerRe: How to validate a socket descripter Pin
Chuck O'Toole7-Mar-12 5:24
Chuck O'Toole7-Mar-12 5:24 
GeneralRe: How to validate a socket descripter Pin
jschell9-Mar-12 5:07
jschell9-Mar-12 5:07 
QuestionProblem with button on Win7 Pin
john56326-Mar-12 21:05
john56326-Mar-12 21:05 
AnswerRe: Problem with button on Win7 Pin
enhzflep7-Mar-12 7:08
enhzflep7-Mar-12 7:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.