ImageAttributes.ClearThreshold 方法

定義

清除臨界值。Clears the threshold value.

多載

ClearThreshold()

清除預設分類的閾值。Clears the threshold value for the default category.

ClearThreshold(ColorAdjustType)

清除指定分類的閾值。Clears the threshold value for a specified category.

ClearThreshold()

清除預設分類的閾值。Clears the threshold value for the default category.

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

備註

閾值是介於0到1之間的值, 可指定每個色彩元件的截止點。The threshold is a value from 0 through 1 that specifies a cutoff point for each color component. 例如, 假設 [臨界值] 設定為 0.7, 而且假設您要轉譯色彩, 其紅色、綠色和藍色元件分別為230、50和220。For example, suppose the threshold is set to 0.7, and suppose you are rendering a color whose red, green, and blue components are 230, 50, and 220, respectively. 紅色元件 (230) 大於 0.7 x255, 因此紅色元件會變更為 255 (完整濃度)。The red component (230) is greater than 0.7x255, so the red component will be changed to 255 (full intensity). 綠色元件 (50) 小於 0.7 x255, 因此綠色元件會變更為0。The green component (50) is less than 0.7x255, so the green component will be changed to 0. 藍色元件 (220) 大於 0.7 x255, 因此藍色元件會變更為255。The blue component (220) is greater than 0.7x255, so the blue component will be changed to 255.

ImageAttributes物件會維護五個調整類別的色彩和灰階設定: 預設、點陣圖、筆刷、畫筆和文字。An ImageAttributes object maintains color and grayscale settings for five adjustment categories: default, bitmap, brush, pen, and text. 例如, 您可以指定預設類別的臨界值、點陣圖類別目錄的不同臨界值, 以及畫筆類別目錄的不同閾值。For example, you can specify a threshold for the default category, a different threshold for the bitmap category, and still a different threshold 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.

ClearThreshold(ColorAdjustType)

清除指定分類的閾值。Clears the threshold value for a specified category.

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

參數

type
ColorAdjustType

ColorAdjustType 的元素,指定已清除閾值的分類。An element of ColorAdjustType that specifies the category for which the threshold is cleared.

備註

閾值是介於0到1之間的值, 可指定每個色彩元件的截止點。The threshold is a value from 0 through 1 that specifies a cutoff point for each color component. 例如, 假設 [臨界值] 設定為 0.7, 而且假設您要轉譯色彩, 其紅色、綠色和藍色元件分別為230、50和220。For example, suppose the threshold is set to 0.7, and suppose you are rendering a color whose red, green, and blue components are 230, 50, and 220, respectively. 紅色元件 (230) 大於 0.7 x55, 因此紅色元件會變更為 255 (完整濃度)。The red component (230) is greater than 0.7x55, so the red component will be changed to 255 (full intensity). 綠色元件 (50) 小於 0.7 x255, 因此綠色元件會變更為0。The green component (50) is less than 0.7x255, so the green component will be changed to 0. 藍色元件 (220) 大於 0.7 x255, 因此藍色元件會變更為255。The blue component (220) is greater than 0.7x255, so the blue component will be changed to 255.

ImageAttributes物件會維護五個調整類別的色彩和灰階設定: 預設、點陣圖、筆刷、畫筆和文字。An ImageAttributes object maintains color and grayscale settings for five adjustment categories: default, bitmap, brush, pen, and text. 例如, 您可以指定預設類別的臨界值、點陣圖類別目錄的不同臨界值, 以及畫筆類別目錄的不同閾值。For example, you can specify a threshold for the default category, a different threshold for the bitmap category, and still a different threshold 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. 例如, 假設您為預設分類指定了臨界值和 gamma 值。For example, suppose you specify a threshold and a gamma value for the default category. 如果您藉由呼叫SetThreshold方法來設定 [畫筆] 類別的臨界值, 則預設臨界值將不會套用至畫筆。If you set the threshold for the pen category by calling the SetThreshold method, the default threshold will not apply to pens. 如果您稍後藉由呼叫ClearThreshold方法來清除 [畫筆] 臨界值, 則 [畫筆] 分類不會還原為預設臨界值; 而 [畫筆] 分類則不會有任何臨界值。If you later clear the pen threshold by calling the ClearThreshold method, the pen category will not revert to the default threshold; rather, the pen category will have no threshold. 同樣地, 畫筆類別目錄也不會還原為預設的 gamma 值。相反地, 畫筆類別目錄將沒有 gamma 值。Similarly, the pen category will not revert to the default gamma value; rather, the pen category will have no gamma value.

適用於