public static BitmapSource ConvertToBitmapSource(FrameworkElement element) { var pageSize = new System.Windows.Size(element.ActualWidth, element.ActualHeight); element.Measure(pageSize); element.Arrange(new Rect(pageSize)); element.UpdateLayout(); RenderTargetBitmap bmp = new RenderTargetBitmap((int)pageSize.Width, (int)pageSize.Height, 96, 96, PixelFormats.Pbgra32); bmp.Render(element); return bmp; }
Clipboard.SetImage(bitmapsource);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)