ImageAttributes.SetOutputChannelColorProfile 方法

定义

设置输出通道颜色配置文件。Sets the output channel color-profile file.

重载

SetOutputChannelColorProfile(String)

为默认类别设置输出通道颜色配置文件。Sets the output channel color-profile file for the default category.

SetOutputChannelColorProfile(String, ColorAdjustType)

为指定类别设置输出通道颜色配置文件。Sets the output channel color-profile file for a specified category.

SetOutputChannelColorProfile(String)

为默认类别设置输出通道颜色配置文件。Sets the output channel color-profile file for the default category.

public:
 void SetOutputChannelColorProfile(System::String ^ colorProfileFilename);
public void SetOutputChannelColorProfile (string colorProfileFilename);
member this.SetOutputChannelColorProfile : string -> unit
Public Sub SetOutputChannelColorProfile (colorProfileFilename As String)

参数

colorProfileFilename
String

颜色配置文件的路径名。The path name of a color-profile file. 如果颜色配置文件位于 %SystemRoot%\System32\Spool\Drivers\Color 目录中,则该参数可以是该文件的文件名。If the color-profile file is in the %SystemRoot%\System32\Spool\Drivers\Color directory, this parameter can be the file name. 否则,该参数必须是完全限定的路径名。Otherwise, this parameter must be the fully qualified path name.

注解

您可以使用 SetOutputChannelSetOutputChannelColorProfile 方法将图像转换为 CMYK (青色-洋红色-黄色-黑色)颜色空间,并检查其中一个 CMYK 颜色通道的浓度。You can use the SetOutputChannel and SetOutputChannelColorProfile methods to convert an image to a CMYK (cyan-magenta-yellow-black) color space and examine the intensities of one of the CMYK color channels. 例如,假设您编写代码来执行以下步骤:For example, suppose you write code that performs the following steps:

  1. 创建 ImageCreate an Image.

  2. 创建 ImageAttributes 对象。Create an ImageAttributes object.

  3. ColorChannelC 传递到 ImageAttributes 对象的 SetOutputChannel 方法。Pass ColorChannelC to the SetOutputChannel method of the ImageAttributes object.

  4. 将颜色配置文件的路径名传递到 ImageAttributes 对象的 SetOutputChannelColorProfile 方法。Pass the path name of a color profile file to the SetOutputChannelColorProfile method of the ImageAttributes object.

  5. ImageImageAttributes 对象的路径传递给 DrawImage 方法。Pass the paths of the Image and ImageAttributes objects to the DrawImage method.

GDI+GDI+ 将使用颜色配置文件来计算图像中每个像素的青色分量,并且呈现图像中的每个像素都是灰色阴影,指示其青色通道的强度。will use the color-profile file to calculate the cyan component of each pixel in the image, and each pixel in the rendered image will be a shade of gray that indicates the intensity of its cyan channel.

ImageAttributes 对象维护五个调整类别的颜色和灰度设置:默认值、位图、画笔、笔和文本。An ImageAttributes object maintains color and grayscale settings for five adjustment categories: default, bitmap, brush, pen, and text. 例如,你可以为默认类别指定输出通道颜色配置文件,并为位图类别指定不同的输出通道颜色配置文件。For example, you can specify an output channel color-profile file for the default category and a different output channel color-profile file for the bitmap 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 bitmap category, the default settings apply to the bitmap category.

SetOutputChannelColorProfile(String, ColorAdjustType)

为指定类别设置输出通道颜色配置文件。Sets the output channel color-profile file for a specified category.

public:
 void SetOutputChannelColorProfile(System::String ^ colorProfileFilename, System::Drawing::Imaging::ColorAdjustType type);
public void SetOutputChannelColorProfile (string colorProfileFilename, System.Drawing.Imaging.ColorAdjustType type);
member this.SetOutputChannelColorProfile : string * System.Drawing.Imaging.ColorAdjustType -> unit
Public Sub SetOutputChannelColorProfile (colorProfileFilename As String, type As ColorAdjustType)

参数

colorProfileFilename
String

颜色配置文件的路径名。The path name of a color-profile file. 如果颜色配置文件位于 %SystemRoot%\System32\Spool\Drivers\Color 目录中,则该参数可以是该文件的文件名。If the color-profile file is in the %SystemRoot%\System32\Spool\Drivers\Color directory, this parameter can be the file name. 否则,该参数必须是完全限定的路径名。Otherwise, this parameter must be the fully qualified path name.

type
ColorAdjustType

ColorAdjustType 的一个元素,指定将设置输出通道颜色配置文件的类别。An element of ColorAdjustType that specifies the category for which the output channel color-profile file is set.

注解

您可以使用 SetOutputChannelSetOutputChannelColorProfile 方法将图像转换为 CMYK (青色-洋红色-黄色-黑色)颜色空间,并检查其中一个 CMYK 颜色通道的浓度。You can use the SetOutputChannel and SetOutputChannelColorProfile methods to convert an image to a CMYK (cyan-magenta-yellow-black) color space and examine the intensities of one of the CMYK color channels. 例如,假设您编写代码来执行以下步骤:For example, suppose you write code that performs the following steps:

  1. 创建 ImageCreate an Image.

  2. 创建 ImageAttributes 对象。Create an ImageAttributes object.

  3. ColorChannelC 传递到 ImageAttributes 对象的 SetOutputChannel 方法。Pass ColorChannelC to the SetOutputChannel method of the ImageAttributes object.

  4. 将颜色配置文件的路径名传递到 ImageAttributes 对象的 SetOutputChannelColorProfile 方法。Pass the path name of a color profile file to the SetOutputChannelColorProfile method of the ImageAttributes object.

  5. ImageImageAttributes 对象的路径传递给 DrawImage 方法。Pass the paths of the Image and ImageAttributes objects to the DrawImage method.

GDI+GDI+ 将使用颜色配置文件来计算图像中每个像素的青色分量,并且呈现图像中的每个像素都是灰色阴影,指示其青色通道的强度。will use the color-profile file to calculate the cyan component of each pixel in the image, and each pixel in the rendered image will be a shade of gray that indicates the intensity of its cyan channel.

ImageAttributes 对象维护五个调整类别的颜色和灰度设置:默认值、位图、画笔、笔和文本。An ImageAttributes object maintains color and grayscale settings for five adjustment categories: default, bitmap, brush, pen, and text. 例如,你可以为默认类别指定输出通道颜色配置文件,并为位图类别指定不同的输出通道颜色配置文件。For example, you can specify an output channel color-profile file for the default category and a different output channel color-profile file for the bitmap 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 bitmap category, the default settings apply to the bitmap 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. 如果通过将 Bitmap 传递到 SetOutputChannelColorProfile 方法来设置位图类别的输出通道颜色配置文件,则没有任何默认调整设置将应用于位图。If you set the output channel color-profile file for the bitmap category by passing Bitmap to the SetOutputChannelColorProfile method, none of the default adjustment settings will apply to bitmaps.

适用于