संपादित करें

इसके माध्यम से साझा किया गया


ImageAttributes.SetColorMatrices Method

Definition

Sets the color-adjustment matrix and the grayscale-adjustment matrix.

Overloads

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)

Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs

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);
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)

Parameters

newColorMatrix
ColorMatrix

The color-adjustment matrix.

grayMatrix
ColorMatrix

The grayscale-adjustment matrix.

Remarks

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.

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 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.

Applies to

SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag)

Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs

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);
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)

Parameters

newColorMatrix
ColorMatrix

The color-adjustment matrix.

grayMatrix
ColorMatrix

The grayscale-adjustment matrix.

flags
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.

Remarks

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.

Applies to

SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag, ColorAdjustType)

Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs

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);
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)

Parameters

newColorMatrix
ColorMatrix

The color-adjustment matrix.

grayMatrix
ColorMatrix

The grayscale-adjustment matrix.

mode
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

An element of ColorAdjustType that specifies the category for which the color-adjustment and grayscale-adjustment matrices are set.

Remarks

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. 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.

Applies to