How to create an image of a WPF UserControl at runtime

You can render a WPF control to a bitmap using RenderTargetBitmap, then this image can be copied to the clipboard, saved to a file, or used as part of your GUI

Check out Get a bitmap image from a Control view

Beware with this that you can hit problems when parts of the control you are trying to render are not visible (within a scroll viewer perhaps)

Leave a Comment