Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to add an image into resource library?

how to add an image into resource library?

Scheduled Pinned Locked Moved C#
csharpvisual-studiotutorialquestionlearning
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Susuko
    wrote on last edited by
    #1

    [VS .NET 2005] i want to add by code an image into resource library starting by the path of the image... how?

    J L 2 Replies Last reply
    0
    • S Susuko

      [VS .NET 2005] i want to add by code an image into resource library starting by the path of the image... how?

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • J Judah Gabriel 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

        S Offline
        S Offline
        Susuko
        wrote on last edited by
        #3

        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)"; } } }

        J 1 Reply Last reply
        0
        • S Susuko

          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)"; } } }

          J Offline
          J Offline
          Judah Gabriel Himango
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • S Susuko

            [VS .NET 2005] i want to add by code an image into resource library starting by the path of the image... how?

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            try this : http://www.aisto.com/roeder/DotNet/ Use Resourcer. You can add image to resource file.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups