U
UJ
I've got an image I want to embed in a dll to use on a screen later. I've
got it in a resource file, got it to compile in to the dll. The problem is
getting it back out. It seems like my problem is in the get resource code.
The code I'm using is:
System.Reflection.Assembly myAssembly;
myAssembly = this.GetType().Assembly;
// Creates the ResourceManager.
System.Resources.ResourceManager myManager = new
System.Resources.ResourceManager("Marlin.VisualControls",
myAssembly);
// Retrieves Image resource.
System.Drawing.Image myImage;
myImage =
(System.Drawing.Image)myManager.GetObject("ECSStartupGraphic");
I can't tell whether it's the resource manager that is set up wrong or the
get object is wrong (I have a feeling the resource manager is wrong.)
The namespace that the resource is in is Marlin.VisualControls. The name of
the object is ECSStartupGraphic (I verified this through resource editor and
also by looking at the file.)
I've also added the file to the project and set it's Build Action as
Embedded Resource.
I just can't seem to get the references right.
And if I've got a window with this image on it (it will always be this
image) is there someway to tell it the file is a reference instead of trying
to look at the disk somewhere?
TIA - Jeff.
got it in a resource file, got it to compile in to the dll. The problem is
getting it back out. It seems like my problem is in the get resource code.
The code I'm using is:
System.Reflection.Assembly myAssembly;
myAssembly = this.GetType().Assembly;
// Creates the ResourceManager.
System.Resources.ResourceManager myManager = new
System.Resources.ResourceManager("Marlin.VisualControls",
myAssembly);
// Retrieves Image resource.
System.Drawing.Image myImage;
myImage =
(System.Drawing.Image)myManager.GetObject("ECSStartupGraphic");
I can't tell whether it's the resource manager that is set up wrong or the
get object is wrong (I have a feeling the resource manager is wrong.)
The namespace that the resource is in is Marlin.VisualControls. The name of
the object is ECSStartupGraphic (I verified this through resource editor and
also by looking at the file.)
I've also added the file to the project and set it's Build Action as
Embedded Resource.
I just can't seem to get the references right.
And if I've got a window with this image on it (it will always be this
image) is there someway to tell it the file is a reference instead of trying
to look at the disk somewhere?
TIA - Jeff.