Men nujen poluchit foto ot IP cameri. Naprimet v C# eto tak, a kak na delphi?
private void button2_Click(object sender, EventArgs e)
{
byte[] buffer = new byte
[100000];
int read, total = 0;
try
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("
http://192.168.1.253/nphMotionJpeg?Resolution=320x240&Quality=Standard");
req.Method = "POST";
//req.Timeout = 500;
NetworkCredential cred = new NetworkCredential("Administrator", "admintdx");
req.Credentials = cred;
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));
pictureBox1.Image = bmp;
}
catch (Exception ex)
{
MessageBox.Show("Grab Error:" + ex, "Error!!");
}