Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
hello
how to create Resource file runtime and how i can save imga ein this and read that image ?
thank
Posted

Hi,

Simply Reading MSDN Article on Creating Resource File in Desktop application[^] will gives you all the information.

You do not need to read anything more. And about storing Image, you can store image path in resource file.

Hope you got your answer from this link
Thanks
-Amit Gajjar
 
Share this answer
 
C#
private void simpleButton1_Click(object sender, EventArgs e)
  {
      using (System.IO.MemoryStream oStream = new System.IO.MemoryStream())
      {
          this.layoutControl1.SaveLayoutToStream(oStream);
          using (ResXResourceWriter oWriter = new ResXResourceWriter(@"..\..\Properties\LayoutControl.resources.Resx"))
          {
              oWriter.AddResource("one", oStream.GetBuffer());
              oWriter.Generate();
              oWriter.Close();
          }
      }

  }

  private void simpleButton2_Click(object sender, EventArgs e)
  {
      ResourceManager rm = new ResourceManager("WindowsFormsApplication1.LayoutControl", Assembly.GetExecutingAssembly());
      var one = rm.GetObject("one");
      Console.WriteLine("");
  }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900