why can I not add a wpfImage of type BitmapImage/BitmapSource/ImageSource to a Resource file.
Yes its not serializeable… So how can I workaround this? I need to put my bitmapImages in a Resource file with key/value access programatically.
using (ResXResourceWriter writer = new ResXResourceWriter("TBM.Resource"))
{
writer.AddResource(fileExtension, wpfImage);
writer.Generate();
}
Resx files were not designed to be used with WPF images. They work fine with GDI images though, so you can save the image to a
System.Drawing.Bitmap, and add it to the resource file.