示例#1
0
 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);
 }
示例#2
0
        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;
            }
        }