D3DMXLoadSurfaceFromFile
A version of this page is also available for
4/8/2010
This function loads a surface from a file.
Syntax
HRESULT WINAPI D3DMXLoadSurfaceFromFileW(
LPDIRECT3DMOBILESURFACE pDestSurface,
CONST PALETTEENTRY* pDestPalette,
CONST RECT* pDestRect,
LPCWSTR pSrcFile,
CONST RECT* pSrcRect,
DWORD Filter,
D3DMCOLOR ColorKey,
D3DMXIMAGE_INFO* pSrcInfo
);
#define D3DMXLoadSurfaceFromFile D3DMXLoadSurfaceFromFileW
Parameters
- pDestSurface
[in] Pointer to an IDirect3DMobileSurface interface. Specifies the destination surface, which receives the image.
- pDestPalette
[in] Pointer to a PALETTEENTRY structure, the destination palette of 256 colors or NULL.
- pDestRect
[in] Pointer to a RECT structure. Specifies the destination rectangle. Set this parameter to NULL to specify the entire surface.
- pSrcFile
[in] Pointer to a string that specifies the filename.
- pSrcRect
[in] Pointer to a RECT structure. Specifies the source rectangle. Set this parameter to NULL to specify the entire image.
- Filter
[in] A combination of one or more flags from the D3DMX_FILTER Values to control how the image is filtered. Specifying D3DMX_DEFAULT for this parameter is the equivalent of specifying D3DMX_FILTER_TRIANGLE | D3DMX_FILTER_DITHER.
- ColorKey
[in] A D3DMCOLOR value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys Thus, for opaque black, the value would be equal to 0xFF000000.
- pSrcInfo
[in, out] A pointer to a D3DMXIMAGE_INFO structure to be filled with a description of the data in the source image file, or NULL.
Return Value
If the function succeeds, the return value is D3DM_OK (see D3DM Values).
If the function fails, the return value can be one of the following values.
Value | Description |
---|---|
D3DERR_INVALIDCALL |
The method call is invalid. For example, a method's parameter may have an invalid value. |
D3DXERR_INVALIDDATA |
The data is invalid. |
Remarks
This function supports the following file formats: .bmp, .dds, .dib, .jpg, .png, and .tga.
This function handles conversion to and from compressed texture formats.
Writing to a non-level-zero surface will not cause the dirty rectangle to be updated. If D3DMXLoadSurfaceFromFile is called and the surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call IDirect3DMobileTexture::AddDirtyRect on the surface.
Requirements
Header | d3dmx.h |
Library | D3dmx.lib |
Windows Embedded CE | Windows Embedded CE 6.0 and later |
Windows Mobile | Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later |
See Also
Reference
D3DMX Functions
IDirect3DMobileSurface
D3DMX_FILTER Values
D3DMCOLOR
D3DMXIMAGE_INFO
D3DM Values
IDirect3DMobileTexture::AddDirtyRect