Editare

Partajați prin


ImageAttributes.SetOutputChannelColorProfile Method

Definition

Sets the output channel color-profile file.

Overloads

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.

SetOutputChannelColorProfile(String, ColorAdjustType)

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

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)

Parameters

colorProfileFilename
String

The path name of a color-profile file. 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

An element of ColorAdjustType that specifies the category for which the output channel color-profile file is set.

Remarks

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. Create an Image.

  2. Create an ImageAttributes object.

  3. Pass ColorChannelC to the SetOutputChannel method of the ImageAttributes object.

  4. Pass the path name of a color profile file to the SetOutputChannelColorProfile method of the ImageAttributes object.

  5. Pass the paths of the Image and ImageAttributes objects to the DrawImage method.

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.

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

Applies to

SetOutputChannelColorProfile(String)

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

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)

Parameters

colorProfileFilename
String

The path name of a color-profile file. 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.

Remarks

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. Create an Image.

  2. Create an ImageAttributes object.

  3. Pass ColorChannelC to the SetOutputChannel method of the ImageAttributes object.

  4. Pass the path name of a color profile file to the SetOutputChannelColorProfile method of the ImageAttributes object.

  5. Pass the paths of the Image and ImageAttributes objects to the DrawImage method.

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.

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.

Applies to