Microsoft Windows CE 3.0  

IDirectDrawSurface5::SetPalette

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The IDirectDrawSurface5::SetPalettemethod attaches a palette object to or detaches one from a surface. The surface uses this palette for all subsequent operations. The palette change takes place immediately, without regard to refresh timing.

HRESULT SetPalette(
LPDIRECTDRAWPALETTE
lpDDPalette
);

Parameters

lpDDPalette
Address of the IDirectDrawPaletteinterface for the palette object to be used with this surface. If this parameter is NULL, the current palette will be detached.

Return Values

If the method succeeds, the return value is DD_OK.

If the method fails, the return value may be one of the following error values:

Remarks

When setting a palette to a surface for the first time, this method increments the palette's reference count; subsequent calls do not affect the palette's reference count. If you pass NULL as the lpDDPaletteparameter, the palette is removed from the surface, and the palette's reference count is decremented. If you do not delete the palette, the surface will automatically release its reference to the palette when the surface itself is released. According to COM rules, your application is responsible for releasing any references it holds to the palette when the object is no longer needed.

It is not currently possible to set a palette to a primary surface in Windows CE.

Requirements

Runs on Versions Declared in Link to
Windows CE OS 2.12 or later. Version 2.12 requires DXPAK 1.0 or later. ddraw.h ddraw.lib

See Also

IDirectDrawSurface5::GetPalette, IDirectDraw4::CreatePalette