I've written a class which is able to display an animated GIF file with Direct2D.
Right now I'm accessing the desired GIF to display via it's FilePath like:
WCHAR szFileName[MAX_PATH] = "C:\\Users\\xxx\\Desktop\\xxx.gif";
m_pIWICFactory->CreateDecoderFromFilename( //My IWICImagingFactory
szFileName,
nullptr,
GENERIC_READ,
WICDecodeMetadataCacheOnLoad,
&m_pDecoder); //My IWICBitmapDecoder
I need to change this part so that the desired GIF will be loaded from the Resources of my Project.
What I did/tried so far:
1)
- I right clicked on My Project, clicked add "Resource"
- In the popup I've selected "Import" and as Resource Type I defined "GIF"
Which resulted in a non-buildable project cause of Error RC2135 in C++ project due to UTF-8 encoding of RC file
Additionally it "destroyed" my GIF file. Opening the GIF in Notepad showed that it got converted from GIF89a to BM6(.bmp) during this process
2)
- I right clicked on My Project, clicked add "Exsisting Item" and selected my GIF
- Then i tried to add the give to the .rc file like IDR_MYGIF GIF ".\resources\xxx.gif"
Which results in "error RC2135: file not found: .\resources\xxx.gif "
So basically I need to know how I can add the GIF correctly to the Resources and how I'll be able to access it in the Code for the IWICBitmapDecoder
Thank you for any help