0

I'm trying to convert a System.Windows.Media.DrawingImage to a System.Drawing.Image object.

I've searched up and down but can't seem to find a match for this conversion. Is it possible to convert between these types?

Thank you

Olivier Jacot-Descombes
  • 104,806
  • 13
  • 138
  • 188
PersuitOfPerfection
  • 1,009
  • 1
  • 15
  • 28
  • I couldn't find anything directly, nor do I know much of the topic, but some quick googling suggests that you can convert to a BitmapSource which you can then convert to an Image. Whether practical or not I couldn't say, hence the comment. – pinkfloydx33 Mar 19 '17 at 00:12
  • In [How to convert System.Drawing.image to System.Windows.Media.BitmapImage?](https://social.msdn.microsoft.com/Forums/vstudio/en-US/aad606b1-3f64-4314-a552-370afd361926/how-to-convert-systemdrawingimage-to-systemwindowsmediabitmapimage?forum=wpf), Avatar of Yuri Usenko Yuri Usenko posted an answer for the reverse operation. – Olivier Jacot-Descombes Mar 19 '17 at 00:39
  • 1
    Note that you can't directly convert a DrawingImage, because it is not a bitmap. So you would have to convert to BitmapSource first, then from BitmapSource to System.Drawing.Bitmap. Search StackOverflow for the second conversion. – Clemens Mar 19 '17 at 08:21
  • Thank you @Clemens, I was able to modify the example in the link you sent to work to my needs. Appreciate it. – PersuitOfPerfection Mar 19 '17 at 17:15

0 Answers0