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. 例如,假设为默认类别指定了阈值和伽玛值。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. 同样,笔类别不会恢复为默认伽玛值;相反,笔类别将没有伽玛值。Similarly, the pen category will not revert to the default gamma value; rather, the pen category will have no gamma value.

适用于