I have argb bitmap. I would like to copy to clipboard. Why doesn't my code work?
var enc = new PngBitmapEncoder();
using (var ms = new MemoryStream())
{
enc.Frames.Add(BitmapFrame.Create((BitmapSource)Img.Source));
enc.Save(ms);
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.StreamSource = ms;
bi.EndInit();
Clipboard.SetImage(bi);
}