Return to Snippet

Revision: 55413
at February 6, 2012 02:34 by caringprogrammer


Initial Code
private System.Drawing.Bitmap BitmapFromSource(BitmapSource bitmapsource)
 {
     System.Drawing.Bitmap bitmap;
     using (MemoryStream outStream = new MemoryStream())
     {
       BitmapEncoder enc = new BmpBitmapEncoder();

       enc.Frames.Add(BitmapFrame.Create(bitmapsource));
       enc.Save(outStream);
       bitmap = new System.Drawing.Bitmap(outStream);
     }
     return bitmap;
 }

Initial URL
http://caringprogrammer.blogspot.com/

Initial Description
Converting BitmapSource to Bitmap in C#

Initial Title
How to convert BitmapSource to Bitmap

Initial Tags
c#

Initial Language
C#