so i have a wpf app, there i have DrawingVisual object, let's call it "visual", also there is RenderTargetBitmap object, let's call it "target". I have some strings of code below.
DrawingVisual visual = new DrawingVisual();
RenderTargetBitmap target = new RenderTargetBitmap(certBg.PixelWidth, certBg.PixelHeight, 96, 96, PixelFormats.Default);
target.Render(visual);
Image img = new Image();
img.Source = target;
How can i save that picture? I thought to use img.Save, but it doesn't work in WPF. I've tried to use BitmapEncoder but it was unsuccsessful. How shall i save on the disk that picture?