© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
uselessxp

❔ best way to include and works with images

I'm working on a project, and I'll have to work with several images.
Actually the project is working with:
string ImageFile1 = @"C:\Users\xxxxx\Desktop\image1.png";
string ImageFile2 = @"C:\Users\xxxxx\Desktop\image2.png";
string ImageFile3 = @"C:\Users\xxxxx\Desktop\image3.png";
string ImageFile4 = @"C:\Users\xxxxx\Desktop\image4.png";
...
string ImageFile1 = @"C:\Users\xxxxx\Desktop\image1.png";
string ImageFile2 = @"C:\Users\xxxxx\Desktop\image2.png";
string ImageFile3 = @"C:\Users\xxxxx\Desktop\image3.png";
string ImageFile4 = @"C:\Users\xxxxx\Desktop\image4.png";
...

Is there a way to improve this?
I'm not referring to the fact I'm using path of my PC, but I'd like to make it more elegant.
Regarding the path I could put images on a project subfolder, adding them as resources, changing the extension with a random one, so final users will not know they are simple .png

But are there other solutions?
I read about the ability to convert an image to a string, using bitmaptostring.
What do you think about?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ 21,000 Images, Best way to implement a lookup method?
C#CC# / help
4y ago
Best Way To Load and Cache Scoped Data?
C#CC# / help
2y ago
❔ Best way to Blazor/CSS and Terminology clarifications
C#CC# / help
3y ago
✅ Best way to use and compare enums? (Unity)
C#CC# / help
3y ago