Microsoft DirectX 8.1 (C++)

D3DXSaveVolumeToFile

Saves a volume to a file.

HRESULT D3DXSaveVolumeToFile(
  LPCTSTR              pDestFile,
  D3DXIMAGE_FILEFORMAT DestFormat,
  LPDIRECT3DVOLUME8    pSrcVolume,
  CONST PALETTEENTRY*  pSrcPalette,
  CONST D3DBOX*        pSrcBox,
);

Parameters

pDestFile
[in] File name in which to save the volume.
DestFormat
[in] D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
pSrcVolume
[in] Pointer to a IDirect3DVolume8 interface, containing the image to be saved.
pSrcPalette
[in] Pointer to a PALETTEENTRY structure containing a palette of 256 colors. This parameter can be NULL.
pSrcBox
[in] Pointer to a D3DBOX structure. Specifies the source box. Set this parameter to NULL to specify the entire volume.

Return Values

If the function succeeds, the return value is D3D_OK.

If the function fails, the return value can be the following value.

D3DERR_INVALIDCALL

Remarks

This function supports the following file formats: .bmp and .dds.

This function handles conversion to and from compressed texture formats.

This function supports both Unicode and ANSI strings.

If the volume is nondynamic (because of a usage parameter set to 0 at the creation) and located in video memory (the memory pool set to D3DPOOL_DEFAULT), D3DXSaveVolumeToFile will fail because Direct3DX cannot lock nondynamic volumes located in video memory.

Requirements

Header: Declared in D3dx8tex.h.
Import Library: Use D3dx8.lib.

See Also

D3DXSaveSurfaceToFile, D3DXSaveTextureToFile