ImageAttributes.SetBrushRemapTable Method (ColorMap[])


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Sets the color-remap table for the brush category.

Namespace:   System.Drawing.Imaging
Assembly:  System.Drawing (in System.Drawing.dll)

member SetBrushRemapTable : 
        map:ColorMap[] -> unit


Type: System.Drawing.Imaging.ColorMap[]

An array of ColorMap objects.

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 SetBrushRemapTable method has the same effect as passing Brush to the SetRemapTable method. The specified remap table applies to items in metafiles that are filled with a brush.

This method is intended to be used only with metafiles.

The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. The code performs the following actions:

  1. Creates a single-element ColorMap array that holds red as the old color and green as the new color.

  2. Passes this array to a newly created ImageAttributes object.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top