RenderTargetBitmap target = new RenderTargetBitmap((int)grid.ActualWidth, (int)grid.ActualHeight, 96d, 96d, PixelFormats.Default);
target.Render(grid);
CroppedBitmap bitmap = new CroppedBitmap(target, new Int32Rect(0, 0, (int)grid.ActualWidth, (int)grid.ActualHeight));
//把他放进粘贴板里面,也可以用其他方式处理
Clipboard.SetImage(bitmap);
grid为你的控件的名字。
标签:控件,target,int,RenderTargetBitmap,Bitmap,Visual,grid,new From: https://www.cnblogs.com/Exceedingly/p/16598626.html