In WinRT C# how do I save an offscreen XAML tree using RenderTargetBitmap?

て烟熏妆下的殇ゞ 提交于 2019-11-30 14:20:12

satur9nine's solution to put the rendered UI tree somewhere behind an opaque foreground seems to be the only supported solution. You could also fiddle with the opacity of the parent element to avoid having it showing up. Another option is to render it yourself with Direct2D or use something like the WinRTXamlToolkit.Composition.Render() methods from WinRT XAML Toolkit.

user3471655

WinRTXamlToolkit.Composition namespace has this extension that works. Just call this method:

await WriteableBitmapRenderExtensions.RenderToPngStream(element);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!