I want to store a canvas on disk as a PNG image.
This works when the canvas is completely shown using this code:
RenderTargetBitmap rtb = new RenderTargetBitmap(794, 1122, 96d, 96d, System.Windows.Media.PixelFormats.Default);
rtb.Render(canvas);
But parts that are not shown at that time are not rendered. When the visual is not shown at all, nothing is rendered.
Then how can I save Canvas build in code to disc without showing it?