views:

2980

answers:

2

Title says it all. How can I convert a System.Windows.Media.ImageSource to System.Drawing.Bitmap?

A: 

Please see HOW TO USE IMAGESOURCE (NO HANDLER) IN WINFORMS AS SYSTEM.DRAWING.BITMAP (HBITMAP):

How to easily convert WinForms System.Drawing.Bitmap into WPF ImageSource you learned from this article. Today, I'll explain how to do it contrary. Actually, all he have to do is to extract handler from BitmapSource, however, such approach is not supported, thus the only thing we can do is just copy pixels of BitmapSource (or BitmapFrame) into byte array and then copy them into the pointer of HBitmap.

Andrew Hare
+1  A: 

There is a blog post describing how to convert System.Windows.Media.ImageSource.BitmapSource to Bitmap.

Matthew Jones