![]() ![]() IWICStream pIWICStream NULL IWICBitmapDecoder pIDecoder NULL IWICBitmapFrameDecode pIDecoderFrame NULL // Resource management. ![]() HRESULT hr SOK // WIC interface pointers. You could then use CreateCompatibleDC, SelectObject, and BitBlt to display it in the target HDC. The resource will be added to the applications resources when the application is built. My data is effectively SRGB, so I want it to be saved in and loaded untransformed. 2 Answers Sorted by: 9 I wrote a blog post (on displaying a splash screen with C++) that contains a full code sample that loads a PNG from a resource and converts it to an HBITMAP (using WIC ). Since the createTextureFromFile and createTextureFromMemory are deprecated, I tried the WIC Loader, but cant figure out how to use it. I basically want to load a texture from a JPG file using D3D. Is this a bug or is this the intended behaviour? I am pretty new to DirectX, and have trouble understanding some of the texture loading. It seems like Save then Load of any particular format should always produce nearly the same result which does not appear to be the case. If I set the format to DXGI_FORMAT_B8G8R8A8_UNORM_SRGB then this doesn't seem to have any affect either way. My internal pixel format is DXGI_FORMAT_R8G8B8A8_UNORM but I'm converting to DXGI_FORMAT_B8G8R8A8_UNORM before saving as this appears to result in more widely supported PNG files. If I set the WIC_FLAGS_IGNORE_SRGB on the call to LoadFromWICFile then the gamma transformation also does not occur. If I use SaveToDDSFile / LoadFromDDSFile then the gamma transformation does not occur. When I do this saving to a PNG the data comes back having had some sort of gamma transformation applied to it. I have a code generated texture which I save to a file and then reload. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |