Sets the color-remap table for the brush category.
Assembly: System.Drawing (in System.Drawing.dll)
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.
This method is intended to be used only with metafiles.
Creates a single-element ColorMap array that holds red as the old color and green as the new color.
Passes this array to a newly created ImageAttributes object.
Public Sub SetBrushRemapTableExample(ByVal e As PaintEventArgs) ' Create a color map. Dim myColorMap(0) As ColorMap myColorMap(0) = New ColorMap myColorMap(0).OldColor = Color.Red myColorMap(0).NewColor = Color.Green ' Create an ImageAttributes object, passing it to the myColorMap ' array. Dim imageAttr As New System.Drawing.Imaging.ImageAttributes imageAttr.SetBrushRemapTable(myColorMap) End Sub
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.