I'm trying to access image resources in my application, but I can't the resources from the application, I just end up with null. I've added the resources in the properties section in visual studio 2008, and the code I'm using is
private ResourceManager res = new ResourceManager("MyNameSpace.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly());
Image myImage = (Image)res.GetObject("myImage.png");
But myImage is always null. I know I could use MyNameSpace.Properties.Resources.myImage.png, but I need to get the resource from a string.
Loading
BillPosted Jul 16, 2008, 3:52 AM
Sateesh ArvetiPosted Jul 16, 2008, 2:21 AM
R u sure that ur resource name is myImage.png.What i suppose is,resource name is wrong.plz check it once,whether resource name is correct or not for that Image in Resources.resx once.