Reputation: 43
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
Upvotes: 4
Views: 21834
Reputation: 3804
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
Upvotes: 3