Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从WPF截图_Wpf_Element_Screenshot - Fatal编程技术网

从WPF截图

从WPF截图,wpf,element,screenshot,Wpf,Element,Screenshot,是否可以在WPF表单上截取单个元素的屏幕截图?我需要拍摄一个“边框”工具及其子工具的屏幕截图。如果你在上面搜索它,你可以使用它来渲染视觉效果,因此如果参考资料不够,应该有一些问题可以帮助你 进一步可能会有所帮助。考虑将源作为您想要拍摄屏幕截图的元素。这是我保存到剪贴板的代码 RenderTargetBitmap bmp = new RenderTargetBitmap((int)source.ActualWidth, (int)source.ActualHeight, 96, 9

是否可以在WPF表单上截取单个元素的屏幕截图?我需要拍摄一个“边框”工具及其子工具的屏幕截图。

如果你在上面搜索它,你可以使用它来渲染视觉效果,因此如果参考资料不够,应该有一些问题可以帮助你

进一步可能会有所帮助。

考虑将作为您想要拍摄屏幕截图的元素。这是我保存到剪贴板的代码

        RenderTargetBitmap bmp = new RenderTargetBitmap((int)source.ActualWidth, (int)source.ActualHeight, 96, 96, PixelFormats.Pbgra32);
        bmp.Render(source);
        Clipboard.SetImage(bmp);