Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void LoadImage(Uri uri)
- {
- this.ResetProgressImage();
- BitmapImage image = new BitmapImage();
- image.DownloadProgress += new EventHandler<DownloadProgressEventArgs>(LoadImageDownloadProgress);
- image.UriSource = uri;
- this.ImageFull.Source = image;
- }
- private void LoadImageDownloadProgress(object sender, DownloadProgressEventArgs e)
- {
- this.Dispatcher.BeginInvoke(delegate
- {
- this.ProgressImage.Value = e.Progress;
- if (e.Progress == 100)
- {
- ImageHelper.Current.Width = Math.Round(this.ImageFull.ActualWidth);
- ImageHelper.Current.Height = Math.Round(this.ImageFull.ActualHeight);
- }
- });
- }
- private void LoadImage(Stream stream)
- {
- this.ResetProgressImage();
- BitmapImage image = new BitmapImage();
- image.DownloadProgress += new EventHandler<DownloadProgressEventArgs>(LoadImageDownloadProgress);
- image.SetSource(stream);
- this.ImageFull.Source = image;
- }
Add Comment
Please, Sign In to add comment