I have instantiated several System.Drawing.Icon Objects. Note that these are created at runtime and are not stored and loaded from the file system. I would like to place these images in my WPF application.
However as I have discovered over the last few hours, it is not possible to simply add an object such as an system.drawing.image or icon directly to the canvas/stack panel, nor is it possible to set the source of a System.Windows.Controls.Image to an image or icon not stored within the file system (or so it seems to me).
Any ideas?
This has worked for me dynamically setting a WPF Image with bytes loaded from a bitmap that was either dynamically generated or loaded from disk: