WPF RenderTargetBitmap截图偏移/留白的三种解决方案

时间:2021-08-26 05:09:14
【文件属性】:
文件名称:WPF RenderTargetBitmap截图偏移/留白的三种解决方案
文件大小:653KB
文件格式:ZIP
更新时间:2021-08-26 05:09:14
WPF RenderTarget 使用RenderTargetBitmap可以快速地在WPF程序中实现对控件呈现内容的截图,但是,这一方案依赖于父类容器的布局,Margin、Padding、BorderThickness等诸多因素均会影响截图效果。 留白、位置偏移等是初学者常遇问题,本文档/代码列举了三种可行的解决方案。
【文件预览】:
CaptureUIElement
----.vs()
--------CaptureUIElement()
----CaptureUIElement()
--------App.xaml.cs(343B)
--------MainWindow.xaml.cs(6KB)
--------lena.jpg(17KB)
--------MainWindow.xaml(2KB)
--------Properties()
--------App.config(187B)
--------App.xaml(386B)
--------CaptureUIElement.csproj(4KB)
----CaptureUIElement.sln(1KB)

网友评论

  • 很不错,谢谢