ImageAttributes::SetBrushRemapTable 方法 (gdiplusimageattributes.h)

ImageAttributes::SetBrushRemapTable 方法會設定筆刷類別的色彩重新對應表。

語法

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

參數

[in] mapSize

類型: UINT

INT ,指定 對應 陣列中的項目數目。

[in] map

類型: ColorMap*

ColorMap 結構的陣列指標。

傳回值

類型: 狀態

如果方法成功,它會傳回 Ok,這是 Status 列舉的元素。

如果方法失敗,它會傳回 Status 列舉的其中一個其他元素。

備註

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

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

範例

下列範例會建立 ImageAttributes 物件,並設定其筆刷重新對應表,讓紅色轉換成綠色。


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

規格需求

需求
最低支援的用戶端 Windows XP、Windows 2000 Professional [僅限傳統型應用程式]
最低支援的伺服器 Windows 2000 Server [僅限傳統型應用程式]
目標平台 Windows
標頭 gdiplusimageattributes.h (include Gdiplus.h)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

點陣圖

色彩

ColorAdjustType

ColorMap

映像

ImageAttributes

元檔

重新著色