There is one pretty brutal way of doing it: write a bitmap to
MemoryStream
using one library and read it using another one; this method works in both directions.
If you needed to go from System.Drawing to System.Windows.Media, the solution would be in using
System.Windows.Interop.Imaging
,
http://msdn.microsoft.com/en-us/library/system.windows.interop.imaging.aspx[
^].
Unfortunately, you need to do your conversion in the opposite direction, so I don't know other way then using the
MemoryStream
. Now, the code sample is already available on the page referenced by Abhinav, you simply did not recognize it. Go lower, find the sample code by the keyword "MemoryStream" and invert the direction of conversion.
—SA