Search code examples
wpfwinformsimage-processingdrawingsystem.drawing

Image representation suitable for both WPF and Windows Forms


When working with Windows forms and images, I deal with System.Drawing.Image descendats. When I work with WPF I deal with System.Windows.Media.Imaging.BitmapSource class.

Is there a UI framework independent way of referencing a memory image? Maybe it would be a Intptr or byte array?

Thank you.


Solution

  • You should be able to get them both to work with a MemoryStream pointing at a byte array (makes sense to me anyway!)

    Haven't tried the WinForms way, but you can certainly do that with WPF.