Export (0) Print
Expand All

IWICPalette::InitializePredefined method

Initializes the palette to one of the pre-defined palettes specified by WICBitmapPaletteType and optionally adds a transparent color.

Syntax


HRESULT InitializePredefined(
  [in]  WICBitmapPaletteType ePaletteType,
  [in]  BOOL fAddTransparentColor
);

Parameters

ePaletteType [in]

Type: WICBitmapPaletteType

The desired pre-defined palette type.

fAddTransparentColor [in]

Type: BOOL

The optional transparent color to add to the palette. If no transparent color is needed, use 0. When initializing to a grayscale or black and white palette, set this parameter to FALSE.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

If a transparent color is added to a palette, the palette is no longer predefined and is returned as WICBitmapPaletteTypeCustom. For palettes with less than 256 entries, the transparent entry is added to the end of the palette (that is, a 16-color palette becomes a 17-color palette). For palettes with 256 colors, the transparent palette entry will replace the last entry in the pre-defined palette.

Requirements

Minimum supported client

Windows XP with SP2, Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Wincodec.h

IDL

Wincodec.idl

Library

Windowscodecs.lib

DLL

Windowscodecs.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft