Nervous_cat
Nervous_cat

Reputation: 19

Converting from Windows.Media.DrawingImage to Windows.Media.Imaging.BitMapImage or Windows.Media.ImageSource

Am having some trouble that i'm recieving an input from wpf that is of type Windows.Media.DrawingImage and I need to convert it to either windows.media.ImageSource or to windows.media.BitmapImage inorder for me to convert those into System.drawing.bitmap or System.drawing.image.

I have already searched extensively online, but could not find an answer. I would be very graeful if someone were to help me out

thank you!

Upvotes: 0

Views: 3319

Answers (1)

Vinit Sankhe
Vinit Sankhe

Reputation: 19895

Windows.Media.DrawingImage is itself an ImageSource so you can set this as a source to any Image class...

Here is an example .... http://msdn.microsoft.com/en-us/library/system.windows.media.drawingimage.aspx

So instead of Image you can use BitmapImage as well ... see this ...

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/aad606b1-3f64-4314-a552-370afd361926/

Does this answer your question?

Upvotes: 2

Related Questions