D3DMXLoadSurfaceFromSurface (Windows Embedded CE 6.0)

1/6/2010

This function loads a surface from another surface, with color conversion.

Syntax

HRESULT WINAPI D3DMXLoadSurfaceFromSurface(
  LPDIRECT3DMOBILESURFACE pDestSurface,
  CONST PALETTEENTRY*     pDestPalette,
  CONST RECT*             pDestRect,
  LPDIRECT3DMOBILESURFACE pSrcSurface,
  CONST PALETTEENTRY*     pSrcPalette,
  CONST RECT*             pSrcRect,
  DWORD                   Filter,
  D3DMCOLOR               ColorKey
);

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.
  • pSrcData
    [in] An LPCVOID pointer to a file in memory.
  • SrcDataSize
    [in] A UINT value that indicates the size, in bytes, of the file in memory.
  • pSrcSurface
    [in] A pointer to an IDirect3DMobileSurface interface for the source surface.
  • pSrcPalette
    [in] A pointer to a PALETTEENTRY structure, the source palette of 256 colors or NULL.
  • 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.

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 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

See Also

Reference

D3DMX Functions
IDirect3DMobileSurface
D3DMX_FILTER Values
D3DMCOLOR
D3DM Values
IDirect3DMobileTexture::AddDirtyRect

Other Resources

PALETTEENTRY
RECT
PALETTEENTRY