how to add an image into resource library?
-
[VS .NET 2005] i want to add by code an image into resource library starting by the path of the image... how?
You cannot add an image into the resources (.resx) of an application without recompiling the whole thing, AFAIK. This is because embedded resources are actually compiled into the target app. Perhaps if you describe what you're trying to accomplish, we might be able to help you find an alternative solution.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
You cannot add an image into the resources (.resx) of an application without recompiling the whole thing, AFAIK. This is because embedded resources are actually compiled into the target app. Perhaps if you describe what you're trying to accomplish, we might be able to help you find an alternative solution.
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
i do that to load an image and set as background for a panel, but it works on my pc where i have got the images then if i run it on another pc it doesn't show background image couse they aren't on the other pc, so i've think to move it into resource: [EditorAttribute(typeof(MyFileNameEditor), typeof(UITypeEditor))] [Category("Image state"), Description("Mouse over image")] //[DefaultValue("")] public string MouseMovePath { get { return MouseMove_path; } set { try { MouseMove_path = value; FileStream fs = new FileStream(MouseMove_path, FileMode.Open, FileAccess.Read); move = Image.FromStream(fs); fs.Close(); this.Invalidate(); } catch { MouseMove_path = "(none)"; } } }
-
i do that to load an image and set as background for a panel, but it works on my pc where i have got the images then if i run it on another pc it doesn't show background image couse they aren't on the other pc, so i've think to move it into resource: [EditorAttribute(typeof(MyFileNameEditor), typeof(UITypeEditor))] [Category("Image state"), Description("Mouse over image")] //[DefaultValue("")] public string MouseMovePath { get { return MouseMove_path; } set { try { MouseMove_path = value; FileStream fs = new FileStream(MouseMove_path, FileMode.Open, FileAccess.Read); move = Image.FromStream(fs); fs.Close(); this.Invalidate(); } catch { MouseMove_path = "(none)"; } } }
Yeah, you can embed the image into your assembly. Then to retrieve it, you go
Image image = Properties.Resources.theEmbeddedImageName;
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango
-
[VS .NET 2005] i want to add by code an image into resource library starting by the path of the image... how?
try this : http://www.aisto.com/roeder/DotNet/ Use Resourcer. You can add image to resource file.