|Microsoft DirectX 9.0|
Saves a volume to a file.
LPCTSTR pDestFile, D3DXIMAGE_FILEFORMAT DestFormat, LPDIRECT3DVOLUME9 pSrcVolume, const PALETTEENTRY *pSrcPalette, const D3DBOX *pSrcBox );
- [in] Pointer to a string that specifies the file name of the source image. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.
- [in] D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
- [in] Pointer to IDirect3DVolume9 interface, containing the image to be saved.
- [in] Pointer to a PALETTEENTRY structure containing a palette of 256 colors. This parameter can be NULL.
- [in] Pointer to a D3DBOX structure. Specifies the source box. Set this parameter to NULL to specify the entire volume.
If the function succeeds, the return value is D3D_OK.
If the function fails, the return value can be the following.
D3DERR_INVALIDCALL The method call is invalid. For example, a method's parameter may have an invalid value.
The compiler setting also determines the function version. If Unicode is defined, the function call resolves to D3DXSaveVolumeToFileW. Otherwise, the function call resolves to D3DXSaveVolumeToFileA because ANSI strings are being used.
This function supports the following file formats: .bmp and .dds.
This function handles conversion to and from compressed texture formats.
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), D3DXSaveTextureToFile will fail because Direct3D extensions (D3DX) cannot lock nondynamic volumes located in video memory.
Header d3dx9tex.h Import library d3dx9.lib Minimum operating systems Windows 98