Depends on the type of Image.Source , assuming that you have a BitmapSource , as in the article, it should be along these lines:
var encoder = new PngBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create((BitmapSource)image.Source)); using (FileStream stream = new FileStream(filePath, FileMode.Create)) encoder.Save(stream);
source share