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, ColorMatrixFlag) ColorMatrixFlag.Default 呼叫flags方法, 並傳遞給參數。 ImageAttributes.SetColorMatrices(ColorMatrix, ColorMatrix)Calling 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.

適用於