ImageAttributes.SetOutputChannel ImageAttributes.SetOutputChannel ImageAttributes.SetOutputChannel ImageAttributes.SetOutputChannel Method

定義

CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。Sets the CMYK (cyan-magenta-yellow-black) output channel.

オーバーロード

SetOutputChannel(ColorChannelFlag) SetOutputChannel(ColorChannelFlag) SetOutputChannel(ColorChannelFlag) SetOutputChannel(ColorChannelFlag)

既定のカテゴリの CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。Sets the CMYK (cyan-magenta-yellow-black) output channel for the default category.

SetOutputChannel(ColorChannelFlag, ColorAdjustType) SetOutputChannel(ColorChannelFlag, ColorAdjustType) SetOutputChannel(ColorChannelFlag, ColorAdjustType) SetOutputChannel(ColorChannelFlag, ColorAdjustType)

指定されたカテゴリの CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。Sets the CMYK (cyan-magenta-yellow-black) output channel for a specified category.

SetOutputChannel(ColorChannelFlag) SetOutputChannel(ColorChannelFlag) SetOutputChannel(ColorChannelFlag) SetOutputChannel(ColorChannelFlag)

既定のカテゴリの CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。Sets the CMYK (cyan-magenta-yellow-black) output channel for the default category.

public:
 void SetOutputChannel(System::Drawing::Imaging::ColorChannelFlag flags);
public void SetOutputChannel (System.Drawing.Imaging.ColorChannelFlag flags);
member this.SetOutputChannel : System.Drawing.Imaging.ColorChannelFlag -> unit
Public Sub SetOutputChannel (flags As ColorChannelFlag)

パラメーター

flags
ColorChannelFlag ColorChannelFlag ColorChannelFlag ColorChannelFlag

出力チャネルを指定する ColorChannelFlag の要素。An element of ColorChannelFlag that specifies the output channel.

次のコード例は、SetOutputChannel メソッドの使用方法を示します。The following code example demonstrates how to use the SetOutputChannel method. この例を実行するには、Windows フォームに次のコードを貼り付けます。To run this example, paste the following code into a Windows Form. フォームの処理Paintイベントと呼び出しShowOutputChannelsを渡して、eとしてPaintEventArgsします。Handle the form's Paint event and call ShowOutputChannels, passing e as PaintEventArgs.

private void ShowOutputChannels(PaintEventArgs e)
{
    //Create a bitmap from a file.
    Bitmap bmp1 = new Bitmap("c:\\fakePhoto.jpg");

    // Create a new bitmap from the original, resizing it for this example.
    Bitmap bmp2 = new Bitmap(bmp1, new Size(80, 80));

    bmp1.Dispose();

    // Create an ImageAttributes object.
    ImageAttributes imgAttributes = new ImageAttributes();

    // Draw the image unaltered.
    e.Graphics.DrawImage(bmp2, 10, 10);

    // Draw the image, showing the intensity of the cyan channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelC,
        System.Drawing.Imaging.ColorAdjustType.Bitmap);

    e.Graphics.DrawImage(bmp2, new Rectangle(100, 10, bmp2.Width, bmp2.Height),
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);

    // Draw the image, showing the intensity of the magenta channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelM,
        ColorAdjustType.Bitmap);

    e.Graphics.DrawImage(bmp2, new Rectangle(10, 100, bmp2.Width, bmp2.Height),
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);

    // Draw the image, showing the intensity of the yellow channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelY,
        ColorAdjustType.Bitmap);

    e.Graphics.DrawImage(bmp2, new Rectangle(100, 100, bmp2.Width, bmp2.Height), 0, 0,
        bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);

    // Draw the image, showing the intensity of the black channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelK,

        System.Drawing.Imaging.ColorAdjustType.Bitmap);
    e.Graphics.DrawImage(bmp2, new Rectangle(10, 190, bmp2.Width, bmp2.Height),
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);

    //Dispose of the bitmap.
    bmp2.Dispose();

}
Private Sub ShowOutputChannels(ByVal e As PaintEventArgs)

    'Create a bitmap from a file.
    Dim bmp1 As New Bitmap("c:\fakePhoto.jpg")

    ' Create a new bitmap from the original, resizing it for this example.
    Dim bmp2 As New Bitmap(bmp1, New Size(80, 80))

    bmp1.Dispose()

    ' Create an ImageAttributes object.
    Dim imgAttributes As New System.Drawing.Imaging.ImageAttributes()

    ' Draw the image unaltered.
    e.Graphics.DrawImage(bmp2, 10, 10)

    ' Draw the image, showing the intensity of the cyan channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelC, ColorAdjustType.Bitmap)

    e.Graphics.DrawImage(bmp2, New Rectangle(100, 10, bmp2.Width, bmp2.Height), _
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)

    ' Draw the image, showing the intensity of the magenta channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelM, ColorAdjustType.Bitmap)

    e.Graphics.DrawImage(bmp2, New Rectangle(10, 100, bmp2.Width, bmp2.Height), _
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)

    ' Draw the image, showing the intensity of the yellow channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelY, _
        ColorAdjustType.Bitmap)

    e.Graphics.DrawImage(bmp2, New Rectangle(100, 100, bmp2.Width, bmp2.Height), _
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)

    ' Draw the image, showing the intensity of the black channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelK, _
        ColorAdjustType.Bitmap)

    e.Graphics.DrawImage(bmp2, New Rectangle(10, 190, bmp2.Width, bmp2.Height), _
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)

    'Dispose of the bitmap.
    bmp2.Dispose()

End Sub

注釈

使用することができます、 SetOutputChannel CMYK カラー領域をイメージに変換し、CMYK カラー チャネルのいずれかの強度を確認するメソッド。You can use the SetOutputChannel method to convert an image to a CMYK color space and examine the intensities of one of the CMYK color channels. たとえば、作成する、ImageAttributesオブジェクトし、そのビットマップ出力チャネル設定ColorChannelCします。For example, suppose you create an ImageAttributes object and set its bitmap output channel to ColorChannelC. そのパスを渡す場合ImageAttributesオブジェクトをDrawImageメソッドでは、各ピクセルの水色の要素が計算され、描画された画像内の各ピクセルは水色チャネルの輝度を示す灰色の網掛けが。If you pass the path of that ImageAttributes object to the DrawImage method, the cyan component of each pixel is calculated, and each pixel in the rendered image is a shade of gray that indicates the intensity of its cyan channel. 同様に、マゼンタ、黄、および黒のチャネルの輝度を示すイメージをレンダリングすることができます。Similarly, you can render images that indicate the intensities of the magenta, yellow, and black channels.

ImageAttributesオブジェクト調整の 5 つのカテゴリの色およびグレースケールの設定を維持する: 既定、ビットマップ、ブラシ、ペン、およびテキスト。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 for the default category and a different output channel 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.

SetOutputChannel(ColorChannelFlag, ColorAdjustType) SetOutputChannel(ColorChannelFlag, ColorAdjustType) SetOutputChannel(ColorChannelFlag, ColorAdjustType) SetOutputChannel(ColorChannelFlag, ColorAdjustType)

指定されたカテゴリの CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。Sets the CMYK (cyan-magenta-yellow-black) output channel for a specified category.

public:
 void SetOutputChannel(System::Drawing::Imaging::ColorChannelFlag flags, System::Drawing::Imaging::ColorAdjustType type);
public void SetOutputChannel (System.Drawing.Imaging.ColorChannelFlag flags, System.Drawing.Imaging.ColorAdjustType type);
member this.SetOutputChannel : System.Drawing.Imaging.ColorChannelFlag * System.Drawing.Imaging.ColorAdjustType -> unit
Public Sub SetOutputChannel (flags As ColorChannelFlag, type As ColorAdjustType)

パラメーター

flags
ColorChannelFlag ColorChannelFlag ColorChannelFlag ColorChannelFlag

出力チャネルを指定する ColorChannelFlag の要素。An element of ColorChannelFlag that specifies the output channel.

type
ColorAdjustType ColorAdjustType ColorAdjustType ColorAdjustType

出力チャネルを設定する対象のカテゴリを指定する ColorAdjustType の要素。An element of ColorAdjustType that specifies the category for which the output channel is set.

次のコード例は、SetOutputChannel メソッドの使用方法を示します。The following code example demonstrates how to use the SetOutputChannel method. この例を実行するには、Windows フォームに次のコードを貼り付けます。To run this example, paste the following code into a Windows Form. フォームの処理Paintイベントと呼び出しShowOutputChannelsを渡して、eとしてPaintEventArgsします。Handle the form's Paint event and call ShowOutputChannels, passing e as PaintEventArgs.

private void ShowOutputChannels(PaintEventArgs e)
{
    //Create a bitmap from a file.
    Bitmap bmp1 = new Bitmap("c:\\fakePhoto.jpg");

    // Create a new bitmap from the original, resizing it for this example.
    Bitmap bmp2 = new Bitmap(bmp1, new Size(80, 80));

    bmp1.Dispose();

    // Create an ImageAttributes object.
    ImageAttributes imgAttributes = new ImageAttributes();

    // Draw the image unaltered.
    e.Graphics.DrawImage(bmp2, 10, 10);

    // Draw the image, showing the intensity of the cyan channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelC,
        System.Drawing.Imaging.ColorAdjustType.Bitmap);

    e.Graphics.DrawImage(bmp2, new Rectangle(100, 10, bmp2.Width, bmp2.Height),
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);

    // Draw the image, showing the intensity of the magenta channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelM,
        ColorAdjustType.Bitmap);

    e.Graphics.DrawImage(bmp2, new Rectangle(10, 100, bmp2.Width, bmp2.Height),
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);

    // Draw the image, showing the intensity of the yellow channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelY,
        ColorAdjustType.Bitmap);

    e.Graphics.DrawImage(bmp2, new Rectangle(100, 100, bmp2.Width, bmp2.Height), 0, 0,
        bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);

    // Draw the image, showing the intensity of the black channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelK,

        System.Drawing.Imaging.ColorAdjustType.Bitmap);
    e.Graphics.DrawImage(bmp2, new Rectangle(10, 190, bmp2.Width, bmp2.Height),
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes);

    //Dispose of the bitmap.
    bmp2.Dispose();

}
Private Sub ShowOutputChannels(ByVal e As PaintEventArgs)

    'Create a bitmap from a file.
    Dim bmp1 As New Bitmap("c:\fakePhoto.jpg")

    ' Create a new bitmap from the original, resizing it for this example.
    Dim bmp2 As New Bitmap(bmp1, New Size(80, 80))

    bmp1.Dispose()

    ' Create an ImageAttributes object.
    Dim imgAttributes As New System.Drawing.Imaging.ImageAttributes()

    ' Draw the image unaltered.
    e.Graphics.DrawImage(bmp2, 10, 10)

    ' Draw the image, showing the intensity of the cyan channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelC, ColorAdjustType.Bitmap)

    e.Graphics.DrawImage(bmp2, New Rectangle(100, 10, bmp2.Width, bmp2.Height), _
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)

    ' Draw the image, showing the intensity of the magenta channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelM, ColorAdjustType.Bitmap)

    e.Graphics.DrawImage(bmp2, New Rectangle(10, 100, bmp2.Width, bmp2.Height), _
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)

    ' Draw the image, showing the intensity of the yellow channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelY, _
        ColorAdjustType.Bitmap)

    e.Graphics.DrawImage(bmp2, New Rectangle(100, 100, bmp2.Width, bmp2.Height), _
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)

    ' Draw the image, showing the intensity of the black channel.
    imgAttributes.SetOutputChannel(ColorChannelFlag.ColorChannelK, _
        ColorAdjustType.Bitmap)

    e.Graphics.DrawImage(bmp2, New Rectangle(10, 190, bmp2.Width, bmp2.Height), _
        0, 0, bmp2.Width, bmp2.Height, GraphicsUnit.Pixel, imgAttributes)

    'Dispose of the bitmap.
    bmp2.Dispose()

End Sub

注釈

使用することができます、 SetOutputChannel CMYK カラー領域をイメージに変換し、CMYK カラー チャネルのいずれかの強度を確認するメソッド。You can use the SetOutputChannel method to convert an image to a CMYK color space and examine the intensities of one of the CMYK color channels. たとえば、作成する、ImageAttributesオブジェクトし、そのビットマップ出力チャネル設定ColorChannelCします。For example, suppose you create an ImageAttributes object and set its bitmap output channel to ColorChannelC. そのパスを渡す場合ImageAttributesオブジェクトをDrawImageメソッドでは、各ピクセルの水色の要素が計算され、描画された画像内の各ピクセルは水色チャネルの輝度を示す灰色の網掛けが。If you pass the path of that ImageAttributes object to the DrawImage method, the cyan component of each pixel is calculated, and each pixel in the rendered image is a shade of gray that indicates the intensity of its cyan channel. 同様に、マゼンタ、黄、および黒のチャネルの輝度を示すイメージをレンダリングすることができます。Similarly, you can render images that indicate the intensities of the magenta, yellow, and black channels.

ImageAttributesオブジェクト調整の 5 つのカテゴリの色およびグレースケールの設定を維持する: 既定、ビットマップ、ブラシ、ペン、およびテキスト。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 for the default category and a different output channel 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. 渡すことによって、ビットマップのカテゴリの出力チャネルを設定するかどうかはBitmapSetOutputChannelメソッド、ビットマップに適用なしの既定の調整設定されます。If you set the output channel for the bitmap category by passing Bitmap to the SetOutputChannel method, none of the default adjustment settings will apply to bitmaps.

適用対象