How can I extract the original image stream from a System.Drawing.Bitmap object?
- by skolima
I am embedding images into my assembly using .resx files. Upon runtime, I need to save the images into standalone files, restoring the original content. How can I extract the original file stream from an System.Drawing.Bitmap instance? I know I can create a stream using Bitmap.Save(), but this transcodes (and in effect - inflates) the images, even when saving a PNG back as PNG.
Or perhaps my mistake is reading them from Resource as Bitmap in the first place?