I want to include an image in my Resource.resx
inside Visual Studio 2022 and then use that image. But how can I get that image URL path when I deploy my release application?
First I have created my resource file.
Then I have added my image.
What should I do next if I want to get the URL link to that image?
I assume that when I build the project so release
and debug
creates, then this resource
file will be included as well?
After importing your image into the Resource File you can then reference it from the code using the LoadResource function.
You would load an image file this way:
HANDLE hImage = LoadResource(NULL, MAKEINTRESOURCE(IDR_MYIMAGE));
There is no "URL" or "Path" to the image because it is stored in the executables data section. You merely reference these resources by an identifier. The ID is also specified by the resource file.