Yes, you can load it as IStream, then convert it to WIC, like in this sample I had posted with a GIF : How to define a GIF image in resource file?
How can I use resource file and embed a .jpg file to output executable?
thebluetropics
1,046
Reputation points
My purpose is to be able to embed a .jpg file into the program executable in Visual Studio 2022, then I can use it with Direct2D using WIC.
I have zero experience of using .rc file. But I have tried to work with resource files using Visual Studio's resource editor, or whatever that called.
I prefer to manual writing of .rc file instead using managed tools...
I have background.jpg in my project folder, will this code work?
resource.rc
BackgroundImage Image "background.jpg"
Edit: I got this:
Windows development | Windows API - Win32
Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
Answer accepted by question author