D3DXSaveSurfaceToFileInMemory
Microsoft DirectX 9.0 SDK Update (October 2004)

D3DXSaveSurfaceToFileInMemory Function


Saves a surface to an image file.

Syntax

HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(      

    LPD3DXBUFFER *ppDestBuf,     D3DXIMAGE_FILEFORMAT DestFormat,     LPDIRECT3DSURFACE9 pSrcSurface,     const PALETTEENTRY *pSrcPalette,     const RECT *pSrcRect );

Parameters

ppDestBuf
[in] Address of a pointer to an ID3DXBuffer that will store the source image.
DestFormat
[in] D3DXIMAGE_FILEFORMAT specifying the file format to use when saving. This function supports saving to all D3DXIMAGE_FILEFORMAT formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).
pSrcSurface
[in] Pointer to IDirect3DSurface9 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.
pSrcRect
[in] Pointer to a RECT World Wide Web link structure. Specifies the source rectangle. Set this parameter to NULL to specify the entire image.

Return Value

If the function succeeds, the return value is D3D_OK.

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

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.


Remarks

This function handles conversion to and from compressed texture formats.

Function Information

Headerd3dx9tex.h
Import libraryd3dx9.lib
Minimum operating systems Windows 98

See Also

D3DXSaveVolumeToFileInMemory


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.