The IDirectDraw2::CreatePalette method creates a DirectDrawPalette object for this DirectDraw object.
HRESULT CreatePalette(
DWORD dwFlags,
LPPALETTEENTRY lpColorTable,
LPDIRECTDRAWPALETTE FAR *lplpDDPalette,
IUnknown FAR *pUnkOuter
);
DDPCAPS_1BIT | Indicates that the index is 1 bit. There are two entries in the color table. |
DDPCAPS_2BIT | Indicates that the index is 2 bits. There are four entries in the color table. |
DDPCAPS_4BIT | Indicates that the index is 4 bits. There are 16 entries in the color table. |
DDPCAPS_8BITENTRIES | Indicates that the index refers to an 8-bit color index. This flag is valid only when used with the DDPCAPS_1BIT, DDPCAPS_2BIT, or DDPCAPS_4BIT flag, and when the target surface is in 8 bpp. Each color entry is 1 byte long and is an index to a destination surface's 8-bpp palette. |
DDPCAPS_8BIT | Indicates that the index is 8 bits. There are 256 entries in the color table. |
DDPCAPS_ALLOW256 | Indicates that this palette can have all 256 entries defined. |
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:
DDERR_INVALIDOBJECT |
DDERR_INVALIDPARAMS |
DDERR_NOCOOPERATIVELEVELSET |
DDERR_OUTOFMEMORY |
DDERR_UNSUPPORTED |
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in ddraw.h.
Import Library: Use ddraw.lib.