ImageAttributes.SetColorMatrices 方法

定义

设置颜色调整矩阵和灰度调整矩阵。Sets the color-adjustment matrix and the grayscale-adjustment matrix.

重载

SetColorMatrices(ColorMatrix, ColorMatrix)

为默认类别设置颜色调整矩阵和灰度调整矩阵。Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.

SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag)

为默认类别设置颜色调整矩阵和灰度调整矩阵。Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.

SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag, ColorAdjustType)

为指定类别设置颜色调整矩阵和灰度调整矩阵。Sets the color-adjustment matrix and the grayscale-adjustment matrix for a specified category.

SetColorMatrices(ColorMatrix, ColorMatrix)

为默认类别设置颜色调整矩阵和灰度调整矩阵。Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.

public:
 void SetColorMatrices(System::Drawing::Imaging::ColorMatrix ^ newColorMatrix, System::Drawing::Imaging::ColorMatrix ^ grayMatrix);
public void SetColorMatrices (System.Drawing.Imaging.ColorMatrix newColorMatrix, System.Drawing.Imaging.ColorMatrix grayMatrix);
member this.SetColorMatrices : System.Drawing.Imaging.ColorMatrix * System.Drawing.Imaging.ColorMatrix -> unit
Public Sub SetColorMatrices (newColorMatrix As ColorMatrix, grayMatrix As ColorMatrix)

参数

newColorMatrix
ColorMatrix

颜色调整矩阵。The color-adjustment matrix.

grayMatrix
ColorMatrix

灰度调整矩阵。The grayscale-adjustment matrix.

注解

ImageAttributes 对象维护五个调整类别的颜色和灰度设置:默认值、位图、画笔、笔和文本。An ImageAttributes object maintains color and grayscale settings for five adjustment categories: default, bitmap, brush, pen, and text. 例如,您可以为默认类别指定调整矩阵,为位图类别指定不同调整矩阵,并为钢笔类别指定其他调整矩阵。For example, you can specify adjustment matrices for the default category, different adjustment matrices for the bitmap category, and still different adjustment matrices 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.

调用 ImageAttributes.SetColorMatrices(ColorMatrix, ColorMatrix) 方法等效于调用 ImageAttributes.SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag) 方法并传递 flags 参数的 ColorMatrixFlag.DefaultCalling the ImageAttributes.SetColorMatrices(ColorMatrix, ColorMatrix) method is equivalent to calling the ImageAttributes.SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag) method and passing ColorMatrixFlag.Default for the flags parameter. ColorMatrixFlag.Default 指定所有颜色(包括灰色)都由颜色调整矩阵调整,而不是灰度调整矩阵。ColorMatrixFlag.Default specifies that all colors (including grays) are adjusted by the color-adjustment matrix, not the grayscale-adjustment matrix. 因此,传递给此方法的灰度调整矩阵不起作用。Therefore, the grayscale-adjustment matrix passed to this method has no effect.

SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag)

为默认类别设置颜色调整矩阵和灰度调整矩阵。Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.

public:
 void SetColorMatrices(System::Drawing::Imaging::ColorMatrix ^ newColorMatrix, System::Drawing::Imaging::ColorMatrix ^ grayMatrix, System::Drawing::Imaging::ColorMatrixFlag flags);
public void SetColorMatrices (System.Drawing.Imaging.ColorMatrix newColorMatrix, System.Drawing.Imaging.ColorMatrix grayMatrix, System.Drawing.Imaging.ColorMatrixFlag flags);
member this.SetColorMatrices : System.Drawing.Imaging.ColorMatrix * System.Drawing.Imaging.ColorMatrix * System.Drawing.Imaging.ColorMatrixFlag -> unit
Public Sub SetColorMatrices (newColorMatrix As ColorMatrix, grayMatrix As ColorMatrix, flags As ColorMatrixFlag)

参数

newColorMatrix
ColorMatrix

颜色调整矩阵。The color-adjustment matrix.

grayMatrix
ColorMatrix

灰度调整矩阵。The grayscale-adjustment matrix.

flags
ColorMatrixFlag

ColorMatrixFlag 的元素,它指定将受颜色调整矩阵和灰度调整矩阵影响的图像和颜色的类型。An element of ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment and grayscale-adjustment matrices.

注解

ImageAttributes 对象维护五个调整类别的颜色和灰度设置:默认值、位图、画笔、笔和文本。An ImageAttributes object maintains color and grayscale settings for five adjustment categories: default, bitmap, brush, pen, and text. 例如,您可以为默认类别指定调整矩阵,为位图类别指定不同调整矩阵,并为钢笔类别指定其他调整矩阵。For example, you can specify adjustment matrices for the default category, different adjustment matrices for the bitmap category, and still different adjustment matrices 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.

SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag, ColorAdjustType)

为指定类别设置颜色调整矩阵和灰度调整矩阵。Sets the color-adjustment matrix and the grayscale-adjustment matrix for a specified category.

public:
 void SetColorMatrices(System::Drawing::Imaging::ColorMatrix ^ newColorMatrix, System::Drawing::Imaging::ColorMatrix ^ grayMatrix, System::Drawing::Imaging::ColorMatrixFlag mode, System::Drawing::Imaging::ColorAdjustType type);
public void SetColorMatrices (System.Drawing.Imaging.ColorMatrix newColorMatrix, System.Drawing.Imaging.ColorMatrix grayMatrix, System.Drawing.Imaging.ColorMatrixFlag mode, System.Drawing.Imaging.ColorAdjustType type);
member this.SetColorMatrices : System.Drawing.Imaging.ColorMatrix * System.Drawing.Imaging.ColorMatrix * System.Drawing.Imaging.ColorMatrixFlag * System.Drawing.Imaging.ColorAdjustType -> unit
Public Sub SetColorMatrices (newColorMatrix As ColorMatrix, grayMatrix As ColorMatrix, mode As ColorMatrixFlag, type As ColorAdjustType)

参数

newColorMatrix
ColorMatrix

颜色调整矩阵。The color-adjustment matrix.

grayMatrix
ColorMatrix

灰度调整矩阵。The grayscale-adjustment matrix.

mode
ColorMatrixFlag

ColorMatrixFlag 的元素,它指定将受颜色调整矩阵和灰度调整矩阵影响的图像和颜色的类型。An element of ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment and grayscale-adjustment matrices.

type
ColorAdjustType

ColorAdjustType 的一个元素,指定将设置颜色调整矩阵和灰度调整矩阵的类别。An element of ColorAdjustType that specifies the category for which the color-adjustment and grayscale-adjustment matrices are set.

注解

ImageAttributes 对象维护五个调整类别的颜色和灰度设置:默认值、位图、画笔、笔和文本。An ImageAttributes object maintains color and grayscale settings for five adjustment categories: default, bitmap, brush, pen, and text. 例如,您可以为默认类别指定调整矩阵,为位图类别指定不同调整矩阵,并为钢笔类别指定其他调整矩阵。For example, you can specify adjustment matrices for the default category, different adjustment matrices for the bitmap category, and still different adjustment matrices 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 collection of adjustment settings for the default category. 如果通过将 Pen 传递到 SetColorMatrices 方法来设置笔类别的颜色调整矩阵和灰度调整矩阵,则没有任何默认调整设置将应用于钢笔。If you set the color-adjustment and grayscale-adjustment matrices for the pen category by passing Pen to the SetColorMatrices method, none of the default adjustment settings will apply to pens.

适用于