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

前端 未结 2 1652
盖世英雄少女心
盖世英雄少女心 2021-01-03 00:08

The following code throws a cryptic System.ArgumentException from the RenderAsync method \"Value does not fall within the expected range.\" If on the other hand my Canvas is

2条回答
  •  离开以前
    2021-01-03 00:29

    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.

提交回复
热议问题