public Download(Image image) { Status = "Download Completed"; this.Link = "Raw Image"; this.image = image; Thumbnail = ImageLoad.GetThumbnailImage(image, 100); Vault.Controller.AddImageToDownloadFolder(this.image); this.image = null; SD.Garbage.ClearRAM.Clear(); DownloadCompleted?.Invoke(null, EventArgs.Empty); }
private void FetchImage() { try { HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(Link); HttpWebResponse httpWebReponse = (HttpWebResponse)httpWebRequest.GetResponse(); Stream stream = httpWebReponse.GetResponseStream(); this.image = Image.FromStream(stream); Thumbnail = ImageLoad.GetThumbnailImage(image, 100); Controller.AddImageToDownloadFolder(this.image); this.image = null; SD.Garbage.ClearRAM.Clear(); Status = "Download Completed"; } catch (Exception ee) { image = null; Thumbnail = new Bitmap(1, 1); Status = "Download Failed" + " " + ee.Message; } }