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

  2. ImageAttributes建立物件。Create an ImageAttributes object.

  3. 傳遞ColorChannelCImageAttributes物件SetOutputChannel的方法。Pass ColorChannelC to the SetOutputChannel method of the ImageAttributes object.

  4. 將色彩設定檔的路徑名稱傳遞給SetOutputChannelColorProfile ImageAttributes物件的方法。Pass the path name of a color profile file to the SetOutputChannelColorProfile method of the ImageAttributes object.

  5. Image DrawImageImageAttributes物件的路徑傳遞給方法。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. Image建立。Create an Image.

  2. ImageAttributes建立物件。Create an ImageAttributes object.

  3. 傳遞ColorChannelCImageAttributes物件SetOutputChannel的方法。Pass ColorChannelC to the SetOutputChannel method of the ImageAttributes object.

  4. 將色彩設定檔的路徑名稱傳遞給SetOutputChannelColorProfile ImageAttributes物件的方法。Pass the path name of a color profile file to the SetOutputChannelColorProfile method of the ImageAttributes object.

  5. Image DrawImageImageAttributes物件的路徑傳遞給方法。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.

適用於