共用方式為


ImageAttributes.SetBrushRemapTable 方法

定義

多載

SetBrushRemapTable(ColorMap[])

設定筆刷類別目錄的色彩重新對應表格。

SetBrushRemapTable(ReadOnlySpan<ColorMap>)
SetBrushRemapTable(ReadOnlySpan<ValueTuple<Color,Color>>)

SetBrushRemapTable(ColorMap[])

來源:
ImageAttributes.cs
來源:
ImageAttributes.cs
來源:
ImageAttributes.cs
來源:
ImageAttributes.cs
來源:
ImageAttributes.cs

設定筆刷類別目錄的色彩重新對應表格。

public:
 void SetBrushRemapTable(cli::array <System::Drawing::Imaging::ColorMap ^> ^ map);
public:
 void SetBrushRemapTable(... cli::array <System::Drawing::Imaging::ColorMap ^> ^ map);
public void SetBrushRemapTable (System.Drawing.Imaging.ColorMap[] map);
public void SetBrushRemapTable (params System.Drawing.Imaging.ColorMap[] map);
member this.SetBrushRemapTable : System.Drawing.Imaging.ColorMap[] -> unit
Public Sub SetBrushRemapTable (map As ColorMap())
Public Sub SetBrushRemapTable (ParamArray map As ColorMap())

參數

map
ColorMap[]

ColorMap 物件的陣列。

範例

下列程式代碼範例是專為搭配 Windows Forms 使用而設計,而且需要 PaintEventArgse,這是 Paint 事件處理程式的參數。 程式代碼會執行下列動作:

  1. 建立單一元素 ColorMap 陣列,此陣列會將紅色保留為舊色彩,而綠色則為新色彩。

  2. 將此陣列傳遞至新建立的 ImageAttributes 物件。

void SetBrushRemapTableExample( PaintEventArgs^ /*e*/ )
{
   // Create a color map.
   array<ColorMap^>^myColorMap = gcnew array<ColorMap^>(1);
   myColorMap[ 0 ] = gcnew ColorMap;
   myColorMap[ 0 ]->OldColor = Color::Red;
   myColorMap[ 0 ]->NewColor = Color::Green;

   // Create an ImageAttributes object, passing it to the myColorMap
   // array.
   ImageAttributes^ imageAttr = gcnew ImageAttributes;
   imageAttr->SetBrushRemapTable( myColorMap );
}
public void SetBrushRemapTableExample(PaintEventArgs e)
{
             
    // Create a color map.
    ColorMap[] myColorMap = new ColorMap[1];
    myColorMap[0] = new ColorMap();
    myColorMap[0].OldColor = Color.Red;
    myColorMap[0].NewColor = Color.Green;
             
    // Create an ImageAttributes object, passing it to the myColorMap
             
    // array.
    ImageAttributes imageAttr = new ImageAttributes();
    imageAttr.SetBrushRemapTable(myColorMap);
}
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

備註

色彩重新對應數據表是 ColorMap 結構的陣列。 每個 ColorMap 結構都有兩個 Color 物件:一個指定舊色彩,另一個指定對應的新色彩。 在轉譯期間,任何符合重新對應數據表中其中一個舊色彩的色彩,會變更為對應的新色彩。

呼叫 SetBrushRemapTable 方法的效果與將 Brush 傳遞至 SetRemapTable 方法相同。 指定的重新對應表格會套用至填滿筆刷之元檔中的專案。

此方法僅供元檔使用。

適用於

SetBrushRemapTable(ReadOnlySpan<ColorMap>)

來源:
ImageAttributes.cs
來源:
ImageAttributes.cs
public:
 void SetBrushRemapTable(ReadOnlySpan<System::Drawing::Imaging::ColorMap ^> map);
public void SetBrushRemapTable (scoped ReadOnlySpan<System.Drawing.Imaging.ColorMap> map);
member this.SetBrushRemapTable : ReadOnlySpan<System.Drawing.Imaging.ColorMap> -> unit
Public Sub SetBrushRemapTable (map As ReadOnlySpan(Of ColorMap))

參數

適用於

SetBrushRemapTable(ReadOnlySpan<ValueTuple<Color,Color>>)

來源:
ImageAttributes.cs
來源:
ImageAttributes.cs
public:
 void SetBrushRemapTable(ReadOnlySpan<ValueTuple<System::Drawing::Color, System::Drawing::Color>> map);
public void SetBrushRemapTable (scoped ReadOnlySpan<(System.Drawing.Color OldColor, System.Drawing.Color NewColor)> map);
member this.SetBrushRemapTable : ReadOnlySpan<ValueTuple<System.Drawing.Color, System.Drawing.Color>> -> unit
Public Sub SetBrushRemapTable (map As ReadOnlySpan(Of ValueTuple(Of Color, Color)))

參數

適用於