public TransferedImage DownloadImage(string url) { TransferedImage imgOut = new TransferedImage(); byte[] imgData; using (var ms = new MemoryStream()) { Image img = Image.FromFile(url); img.Save(ms, System.Drawing.Imaging.ImageFormat.Gif); imgData = ms.ToArray(); } imgOut.data = imgData; imgOut.Filename = url.Split(@"\".ToArray()).Last(); return(imgOut); }
public TransferedImage DownloadImage(string url) { TransferedImage imgOut = new TransferedImage(); byte[] imgData; using (var ms = new MemoryStream()) { Image img = Image.FromFile(url); img.Save(ms, System.Drawing.Imaging.ImageFormat.Gif); imgData = ms.ToArray(); } imgOut.data = imgData; imgOut.Filename = url.Split(@"\".ToArray()).Last(); return imgOut; }