0
하게 저장, 내 코드는 다음과 같습니다웹 사이트에서 GIF의 그림을 얻으하지만 후에는 내가 웹 사이트에서 GIF의 그림을 얻으하지만 후에는 정적 이미지가 저장 정적 그림
string picurl = "http://www.ifanr.com/wp-content/uploads/2011/10/J1D2AYQV.gif";
string [email protected]"D:\test.gif";
string imgExt = picurl.Substring(picurl.LastIndexOf("."), picurl.Length - picurl.LastIndexOf("."));
WebRequest wreq = WebRequest.Create(picurl);
wreq.Timeout = 10000;
HttpWebResponse wresp = (HttpWebResponse)wreq.GetResponse();
Stream s = wresp.GetResponseStream();
System.Drawing.Image img = System.Drawing.Image.FromStream(s);
if (imgExt == ".gif")
{
img.Save(savepath, ImageFormat.Gif);
}
img.Dispose();
s.Dispose();
누가 나를 도울 수 있습니까? 감사!
"정적 사진"이란 무엇입니까? 애니메이션 프레임이없는 GIF? –
이미지를'Image'로 변환하지 말고 바이너리 스트림을 직접 파일에 저장하십시오. –