How to save texture2d to file? RRS feed

  • Question

  • hi all,

    I want save a ID3D11Texture2D buffer to file. There is a D3DX11SaveTextureToFile API, but only for desktop.

    So is there any way to do this for windows store apps?


    Thursday, December 26, 2013 8:39 AM


  • See the note at the top of the D3DX11SaveTextureToFile documentation:

    Note  Instead of using this function, we recommend that you use the DirectXTex library, CaptureTexture then SaveToXXXFile (where XXX is WIC, DDS, or TGA; WIC doesn't support DDS and TGA; D3DX 9 supported TGA as a common art source format for games). For the simplified scenario of creating a screen shot from a render target texture, we recommend that you use the DirectXTK library, SaveDDSTextureToFile or SaveWICTextureToFile.

    Take a look at the DirectX Toolkit for replacement helper functions for D3DX. Chuck's blog entry Living without D3DX enumerates many equivalents.

    Thursday, December 26, 2013 3:09 PM