public EditionEffect() { InitializeComponent(); try { BitmapImage originalImage = new BitmapImage(); originalImage.BeginInit(); originalImage.UriSource = new Uri(UsersImage.getImagePath(), UriKind.Absolute); originalImage.EndInit(); OriginalImage.Source = originalImage; if (UsersImage.getEditedImageSave()) { BitmapImage editedImage = new BitmapImage(); editedImage.BeginInit(); editedImage.UriSource = new Uri(UsersImage.getEditedImagePath(), UriKind.Absolute); editedImage.EndInit(); EditedImage.Source = editedImage; } } catch (Exception exception) { MessageBox.Show("Error occured: " + exception.Message, "Error!"); } }
public selectingEffect() { InitializeComponent(); try { BitmapImage sourceImage = new BitmapImage(); sourceImage.BeginInit(); sourceImage.UriSource = new Uri(UsersImage.getImagePath(), UriKind.Absolute); sourceImage.EndInit(); OriginalImage.Source = sourceImage; } catch (Exception exception) { MessageBox.Show(exception.Message + "\nPlease choose image properly once again.", "Image isn't set!"); MainWindow mainWindow = new MainWindow(); mainWindow.Show(); this.Close(); } }