WebRequest requestPic = WebRequest.Create(imageURL);
WebResponse responsePic = requestPic.GetResponse();
Image webImage = Image.FromStream(responsePic.GetResponseStream());
// Need to resize image here
Random rand = new Random();
string imageName = string.Format("{0:x}{1:x}", DateTime.Now.Ticks, rand.Next(0, 60400000));
if (webImage != null)
{
webImage.Save(string.Format("c:\\{0}.jpg", imageName));
}
谢谢!
答案 0 :(得分:4)
Image thumb = image.GetThumbnailImage(image.Width / 2, image.Height / 2, null, IntPtr.Zero);
image.Dispose();