Save Image From Webrequest in C#

前端 未结 2 838
难免孤独
难免孤独 2021-01-23 14:47

I\'m using a jQuery webcam plugin to communicate with a webcam in my page and take a snapshot. The way it works is by communicating with a Flash helper. To save the picture it t

2条回答
  •  执笔经年
    2021-01-23 15:43

    You claim to have the code for getting the request, you just need to load the image and save it to disk. This needs cleaned up, but something like the following should work:

    System.IO.Stream respStream = resp.GetResponseStream();
    System.Drawing.Image img = System.Drawing.Image.FromStream(respStream );
    img.Save(PathToSaveTo):
    

提交回复
热议问题