How to save image in image management mode in wpf?

I have a simple wpf WIA application. My application has image control ... I was wondering how to save a scanned image to my hard drive?

+4
source share
2 answers

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); 
+9
source

If this is System.Drawing.Image , then just call Save ?

+1
source

All Articles