ImageAttributes.ClearGamma 方法

定义

禁用灰度校正。Disables gamma correction.

重载

ClearGamma()

为默认类别禁用灰度校正。Disables gamma correction for the default category.

ClearGamma(ColorAdjustType)

为指定类别禁用灰度校正。Disables gamma correction for a specified category.

ClearGamma()

为默认类别禁用灰度校正。Disables gamma correction for the default category.

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

注解

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 gamma value for the default category, a different gamma value for the bitmap category, and still a different gamma value 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.

ClearGamma(ColorAdjustType)

为指定类别禁用灰度校正。Disables gamma correction for a specified category.

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

参数

type
ColorAdjustType

ColorAdjustType 的一个元素,指定将禁用灰度校正的类别。An element of ColorAdjustType that specifies the category for which gamma correction is disabled.

注解

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 gamma value for the default category, a different gamma value for the bitmap category, and still a different gamma value 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, then 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 gamma value and a color-adjustment matrix for the default category. 如果通过调用 SetGamma 方法设置了 "笔" 类别的伽玛值,则默认伽玛值将不适用于笔。If you set the gamma value for the pen category by calling the SetGamma method, the default gamma value will not apply to pens. 如果稍后通过调用 ClearGamma 方法来清除笔伽玛值,则笔类别不会恢复为默认伽玛值;相反,笔类别将没有伽玛值。If you later clear the pen gamma value by calling the ClearGamma method, the pen category will not revert to the default gamma value; rather, the pen category will have no gamma value. 同样,笔类别不会恢复为默认的颜色调整矩阵;相反,笔类别将没有颜色调整矩阵。Similarly, the pen category will not revert to the default color-adjustment matrix; rather, the pen category will have no color-adjustment matrix.

适用于