microsoft / DirectXTK12

The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++
https://walbourn.github.io/directx-tool-kit-for-directx-12/
MIT License
1.48k stars 393 forks source link

Screenshot in dds with wrong colors #65

Closed himuracesar closed 4 years ago

himuracesar commented 4 years ago

Hi everyone,

I use the function SaveDDSTextureToFile to save a screenshot but the image generated change de colors.

I don't know if I need other configuration.

I added the file ScreenGrab.h and initialize it with the next code

`#if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/)
    Microsoft::WRL::Wrappers::RoInitializeWrapper initialize(RO_INIT_MULTITHREADED);
    if (FAILED(initialize))
        Log().Error("Error to initialize DirectX Tool Kit 12 - RO_INIT_MULTITHREADED");
#else
    HRESULT hr = CoInitializeEx(nullptr, COINITBASE_MULTITHREADED);
    if (FAILED(hr))
        Log().Error("Error to initialize DirectX Tool Kit 12 - COINITBASE_MULTITHREADED");
#endif`

It works but the colors are wrong.

Can you help me??

walbourn commented 4 years ago

What do you mean by 'wrong'?

Likely this is an issue of SRGB vs. Linear colors. See the wiki