I want to get a specific value from a resource programmatically. For example, I have a FileName variable which contains the resource Image name.
How to get that resource with this variable?
I try this but not working: (file is null after line 3)
public Bitmap FindImgaeFromResource(string ImageFileName)
{
Assembly thisExe;
thisExe = Assembly.GetExecutingAssembly();
Stream file = thisExe.GetManifestResourceStream(ImageFileName);
return (Bitmap)Image.FromStream(file);
}
This is not WPF application, and I can't use this.tryfindresource().