D3DX11SaveTextureToMemory function

Note

The D3DX (D3DX 9, D3DX 10, and D3DX 11) utility library is deprecated for Windows 8 and is not supported for Windows Store apps.

Note

Instead of using this function, we recommend that you use the DirectXTex library, CaptureTexture then SaveToXXXMemory (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).

Save a texture to memory.

Syntax

HRESULT D3DX11SaveTextureToMemory(
        ID3D11DeviceContext      *pContext,
  _In_  ID3D11Resource           *pSrcTexture,
  _In_  D3DX11_IMAGE_FILE_FORMAT DestFormat,
  _Out_ LPD3D10BLOB              *ppDestBuf,
  _In_  UINT                     Flags
);

Parameters

pContext

Type: ID3D11DeviceContext*

A pointer to an ID3D11DeviceContext object.

pSrcTexture [in]

Type: ID3D11Resource*

Pointer to the texture to be saved. See ID3D11Resource.

DestFormat [in]

Type: D3DX11_IMAGE_FILE_FORMAT

The format the texture will be saved as. See D3DX11_IMAGE_FILE_FORMAT.

ppDestBuf [out]

Type: LPD3D10BLOB*

Address of a pointer to the memory containing the saved texture.

Flags [in]

Type: UINT

Optional.

Return value

Type: HRESULT

The return value is one of the values listed in Direct3D 11 Return Codes.

Requirements

Requirement Value
Header
D3DX11tex.h
Library
D3DX11.lib

See also

D3DX Functions