How to get the image path from Resource file in c# windows forms?

19,816

Try this:

var filePath = System.Reflection.Assembly.GetExecutingAssembly()
                   .Location + @"\..\..\Resources\bar.png";

If your image is a valid resource, you can access it through: Properties.Resources

Share:
19,816
Malini
Author by

Malini

Updated on June 09, 2022

Comments

  • Malini
    Malini almost 2 years

    I want to get the image from Resource folder in c# windows application? already i tried in different ways. But i dint get the correct solution.

    i need the path: "c:test\windowsapp\Resouces\bar.png" instead of start-up and executable path etc.Help me

  • Malini
    Malini almost 12 years
    Yeah,I tried that one already. thanks for ur reply. I wanna split the path and add "Resources\test.png".