ImageAttributes::SetBrushRemapTable method (gdiplusimageattributes.h)

The ImageAttributes::SetBrushRemapTable method sets the color remap table for the brush category.

Syntax

Status SetBrushRemapTable(
  [in] UINT           mapSize,
  [in] const ColorMap *map
);

Parameters

[in] mapSize

Type: UINT

INT that specifies the number of elements in the map array.

[in] map

Type: ColorMap*

Pointer to an array of ColorMap structures.

Return value

Type: Status

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Remarks

A color-remap table is an array of ColorMap structures. Each ColorMap structure has two Color objects: one that specifies an old color and one that specifies a corresponding new color. During rendering, any color that matches one of the old colors in the remap table is changed to the corresponding new color.

Calling the ImageAttributes::SetBrushRemapTable method has the same effect as passing ColorAdjustTypeBrush to the ImageAttributes::SetRemapTable method. The specified remap table applies to items in metafiles that are filled with a brush.

Examples

The following example creates an ImageAttributes object and sets its brush remap table so that red is converted to green.


ImageAttributes imageAtt;
ColorMap cMap;
cMap.oldColor = Color(255, 255, 0, 0);  // red
cMap.newColor = Color(255, 0, 255, 0);  // green
imageAtt.SetBrushRemapTable(1, &cMap);
				

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusimageattributes.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Bitmap

Color

ColorAdjustType

ColorMap

Image

ImageAttributes

Metafile

Recoloring