public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { Image image = value as Image; if (image == null) { return(null); } return(DrawingImageToImageSourceConverter.ConvertBack((BitmapSource)image.Source)); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { System.Drawing.Image drawingImage = value as System.Drawing.Image; if (drawingImage == null) { return(null); } return(new Image() { Source = DrawingImageToImageSourceConverter.Convert(drawingImage, null), Width = Width, Height = Height, Stretch = Stretch }); }