Konvertiert ein BitmapImage zu einem Bitmap
public static Bitmap ConvertBitmapImageToBitmap(BitmapImage bmpImg)
{
if (bmpImg == null)
return null;
using (MemoryStream outStream = new MemoryStream())
{
BitmapEncoder enc = new BmpBitmapEncoder();
enc.Frames.Add(BitmapFrame.Create(bmpImg));
enc.Save(outStream);
return new System.Drawing.Bitmap(outStream);
}
}
Kommentare zum Snippet