How to render offscreen content with RenderTargetBitmap in UWP?

211 Views Asked by At

I'm trying to render the contents of a UserControl to frames the create a video in 1080p, so I created a set the size to my control accordingly:

RenderControl.Width = 1920;
RenderControl.Height = 1080;

After setting the size, I execute this code:

var rendertargetBitmap = new RenderTargetBitmap();
await rendertargetBitmap.RenderAsync(RenderControl);

The problem is that this will only render the contents that are onscreen. I want my contents to be captured even in they're offscreen.

How can I do it? This limitation is really inconvenient. I cannot force users to maximize (or resize) the hosting Window to render a video. It feels really hacky.

0

There are 0 best solutions below