private async Task <BitmapSource> LoadThumbnailAsync(IGoogleDriveFile file, Stream stream) { if (file.ThumbnailLink.HasValue()) { return(await WebImageDownloader.DownloadAsync(file.ThumbnailLink)); } return(BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad)); }
private void DownloadAllImages_Click(object sender, EventArgs e) { var files = new WebImageDownloader(URL).GetSafeUrls(); if (files.Count == 0) { MessageBox.Show("There are either no images to download from this page, or OSIRT is unable to download them.", "No Images to Download", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } using (var downloader = new DownloadForm(files, Enums.Actions.Scraped)) { downloader.ShowDialog(); } }
private async Task <GoogleDriveFileInfoModel> DoLoadThumbnailInfoAsync(IGoogleDriveFile file) { var imageSource = await WebImageDownloader.DownloadAsync(file.ThumbnailLink); return(CreateFileInfo(file, imageSource)); }