Convert System.Windows.Media.Imaging.BitmapSource to System.Drawing.Image

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;
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)