ImageAttributes.ClearColorKey 方法

定義

清除色鍵 (透明度範圍)。Clears the color key (transparency range).

多載

ClearColorKey()

清除預設分類的色鍵 (透明度範圍)。Clears the color key (transparency range) for the default category.

ClearColorKey(ColorAdjustType)

清除指定分類的色鍵 (透明度範圍)。Clears the color key (transparency range) for a specified category.

ClearColorKey()

清除預設分類的色鍵 (透明度範圍)。Clears the color key (transparency range) for the default category.

public:
 void ClearColorKey();
public void ClearColorKey ();
member this.ClearColorKey : unit -> unit
Public Sub ClearColorKey ()

備註

ImageAttributes物件會維護五個調整類別的色彩和灰階設定: 預設、點陣圖、筆刷、畫筆和文字。An ImageAttributes object maintains color and grayscale settings for five adjustment categories: default, bitmap, brush, pen, and text. 例如, 您可以為預設類別、點陣圖類別目錄的不同色彩索引鍵, 以及畫筆類別的不同色彩索引鍵, 指定一個色彩索引鍵。For example, you can specify one color key for the default category, a different color key for the bitmap category, and still a different color key for the pen category.

預設的彩色調整和灰階調整設定適用于沒有自己的調整設定的所有類別。The default color-adjustment and grayscale-adjustment settings apply to all categories that do not have adjustment settings of their own. 例如, 如果您從未針對 [畫筆] 分類指定任何調整設定, 則預設設定會套用至 [畫筆] 分類。For example, if you never specify any adjustment settings for the pen category, the default settings apply to the pen category.

ClearColorKey(ColorAdjustType)

清除指定分類的色鍵 (透明度範圍)。Clears the color key (transparency range) for a specified category.

public:
 void ClearColorKey(System::Drawing::Imaging::ColorAdjustType type);
public void ClearColorKey (System.Drawing.Imaging.ColorAdjustType type);
member this.ClearColorKey : System.Drawing.Imaging.ColorAdjustType -> unit
Public Sub ClearColorKey (type As ColorAdjustType)

參數

type
ColorAdjustType

ColorAdjustType 的元素,指定已經清除色鍵的分類。An element of ColorAdjustType that specifies the category for which the color key is cleared.

備註

ImageAttributes物件會維護五個調整類別的色彩和灰階設定: 預設、點陣圖、筆刷、畫筆和文字。An ImageAttributes object maintains color and grayscale settings for five adjustment categories: default, bitmap, brush, pen, and text. 例如, 您可以為預設類別、點陣圖類別目錄的不同色彩索引鍵, 以及畫筆類別的不同色彩索引鍵, 指定一個色彩索引鍵。For example, you can specify one color key for the default category, a different color key for the bitmap category, and still a different color key for the pen category.

預設的彩色調整和灰階調整設定適用于沒有自己的調整設定的所有類別。The default color-adjustment and grayscale-adjustment settings apply to all categories that do not have adjustment settings of their own. 例如, 如果您從未針對 [畫筆] 分類指定任何調整設定, 則預設設定會套用至 [畫筆] 分類。For example, if you never specify any adjustment settings for the pen category, the default settings apply to the pen category.

當您指定特定分類的彩色調整或灰階調整設定時, 預設調整設定就不再適用于該類別。As soon as you specify a color-adjustment or grayscale-adjustment setting for a certain category, the default adjustment settings no longer apply to that category. 例如, 假設您指定預設的色彩索引鍵, 讓任何色彩具有從200到255透明的紅色元件, 而且您指定了預設的 gamma 值1.8。For example, suppose you specify a default color key that makes any color with a red component from 200 through 255 transparent, and you specify a default gamma value of 1.8. 如果您藉由呼叫SetColorKey方法來設定畫筆類別目錄的色彩索引鍵, 預設的色彩索引鍵和預設 gamma 值將不會套用至畫筆。If you set the color key of the pen category by calling the SetColorKey method, the default color key and the default gamma value will not apply to pens. 如果您稍後藉由呼叫ClearColorKey方法來清除畫筆色彩索引鍵, 則畫筆類別目錄將不會還原為預設的色彩索引鍵; 而畫筆類別目錄將不會有任何色彩索引鍵。If you later clear the pen color key by calling the ClearColorKey method, the pen category will not revert to the default color key; rather, the pen category will have no color key. 同樣地, 畫筆類別目錄也不會還原為預設的 gamma 值。相反地, 畫筆類別目錄將沒有 gamma 值。Similarly, the pen category will not revert to the default gamma value; rather, the pen category will have no gamma value.

適用於