ImageAttributes.ClearColorMatrix 方法
定义
清除颜色调整矩阵。Clears the color-adjustment matrix.
重载
| ClearColorMatrix() |
为默认类别清除颜色调整矩阵。Clears the color-adjustment matrix for the default category. |
| ClearColorMatrix(ColorAdjustType) |
清除指定类别的颜色调整矩阵。Clears the color-adjustment matrix for a specified category. |
ClearColorMatrix()
为默认类别清除颜色调整矩阵。Clears the color-adjustment matrix for the default category.
public:
void ClearColorMatrix();
public void ClearColorMatrix ();
member this.ClearColorMatrix : unit -> unit
Public Sub ClearColorMatrix ()
注解
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 color-adjustment matrix for the default category, a different color-adjustment matrix for the bitmap category, and still a different color-adjustment matrix 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.
适用于
ClearColorMatrix(ColorAdjustType)
清除指定类别的颜色调整矩阵。Clears the color-adjustment matrix for a specified category.
public:
void ClearColorMatrix(System::Drawing::Imaging::ColorAdjustType type);
public void ClearColorMatrix (System.Drawing.Imaging.ColorAdjustType type);
member this.ClearColorMatrix : System.Drawing.Imaging.ColorAdjustType -> unit
Public Sub ClearColorMatrix (type As ColorAdjustType)
参数
- type
- ColorAdjustType
ColorAdjustType 的一个元素,指定将清除颜色调整矩阵的类别。An element of ColorAdjustType that specifies the category for which the color-adjustment matrix 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 a color-adjustment matrix for the default category, a different color-adjustment matrix for the bitmap category, and still a different color-adjustment matrix 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 color-adjustment matrix and a gamma value for the default category. 如果您通过调用方法为 "笔" 类别设置颜色调整矩阵 SetColorMatrix ,则默认颜色调整矩阵将不适用于笔。If you set a color-adjustment matrix for the pen category by calling the SetColorMatrix method, the default color-adjustment matrix will not apply to pens. 如果您随后通过调用方法来清除笔颜色调整矩阵 ClearColorMatrix ,则笔类别将不会恢复为默认调整矩阵; 而是笔类别将没有调整矩阵。If you later clear the pen color-adjustment matrix by calling the ClearColorMatrix method, the pen category will not revert to the default adjustment matrix; rather, the pen category will have no adjustment matrix. 同样,笔类别不会恢复为默认伽玛值;相反,笔类别将没有伽玛值。Similarly, the pen category will not revert to the default gamma value; rather, the pen category will have no gamma value.