void repeat1(PictureBox p, string url, int framenum) { while (true) { framenum++; WebRequest requestPic = WebRequest.Create(url); WebResponse responsePic = requestPic.GetResponse(); if (framenum % 3 == 0) { classification s = new classification(p, Image.FromStream(responsePic.GetResponseStream())); lock (this) { Thread.Sleep(3); mynewframe dm = new mynewframe(loadmyvideo); IAsyncResult m = dm.BeginInvoke(s, null, null); p.Image = dm.EndInvoke(m); } } else { p.Image = Image.FromStream(responsePic.GetResponseStream()); } } }
void repeat() { while (true) { framenum++; WebRequest requestPic = WebRequest.Create(h1); WebResponse responsePic = requestPic.GetResponse(); if (framenum % 3 == 0) { mynewframe dm = new mynewframe(loading); IAsyncResult m = dm.BeginInvoke(Image.FromStream(responsePic.GetResponseStream()), null, null); pictureBox1.Image = dm.EndInvoke(m); } else { pictureBox1.Image = Image.FromStream(responsePic.GetResponseStream()); } } }