ImageAttributes.SetOutputChannelとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ImageAttributes.SetOutputChannelの意味・解説 

ImageAttributes.SetOutputChannel メソッド (ColorChannelFlag, ColorAdjustType)

指定されたカテゴリの CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。

名前空間: System.Drawing.Imaging
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetOutputChannel ( _
    flags As ColorChannelFlag, _
    type As ColorAdjustType _
)
Dim instance As ImageAttributes
Dim flags As ColorChannelFlag
Dim type As ColorAdjustType

instance.SetOutputChannel(flags, type)
public void SetOutputChannel (
    ColorChannelFlag flags,
    ColorAdjustType type
)
public:
void SetOutputChannel (
    ColorChannelFlag flags, 
    ColorAdjustType type
)
public void SetOutputChannel (
    ColorChannelFlag flags, 
    ColorAdjustType type
)
public function SetOutputChannel (
    flags : ColorChannelFlag, 
    type : ColorAdjustType
)

パラメータ

flags

出力チャネルを指定する ColorChannelFlag の要素。

type

出力チャネルを設定する対象のカテゴリを指定する ColorAdjustType の要素。

戻り値
このメソッドは値を返しません。

解説解説

SetOutputChannel メソッドを使用して、イメージを CMYK カラー領域に変換し、CMYK カラー チャネルの 1 つの輝度を調べることができます。たとえば、ImageAttributes オブジェクトを作成し、ビットマップの出力チャネルを ColorChannelC に設定したとします。ImageAttributes オブジェクトのパスを DrawImage メソッドに渡した場合、ピクセルごとに水色の要素が計算され、イメージの各ピクセルは水色チャネルの輝度を示す灰色の網かけで表現されます。同様に、マゼンダ、黄、黒の輝度を示すイメージを表示できます。

ImageAttributes オブジェクトは、5 つの調整カテゴリ (既定、ビットマップ、ブラシ、ペン、テキスト) に関して色とグレースケールの設定を保持します。たとえば、既定のカテゴリにある出力チャネルを指定し、ビットマップ カテゴリには別の出力チャネルを指定できます。

既定のカラー調整設定値およびグレースケール調整設定値は、調整設定値が設定されていないすべてのカテゴリに対して適用されます。たとえば、ビットマップ カテゴリの調整設定を一切指定していない場合、ビットマップ カテゴリには既定の設定が適用されます。

特定のカテゴリに対してカラー調整設定値またはグレースケール調整設定値を指定すると、そのカテゴリに適用されていた既定の調整設定値は解除されます。たとえば、既定のカテゴリに対して調整設定値のコレクションを指定するとします。Bitmap をSetOutputChannel メソッドに渡してビットマップ カテゴリの出力チャネルを設定すると、ビットマップには既定の調整設定は一切適用されません。

使用例使用例

SetOutputChannel メソッドを使用する方法を次のコード例に示します。この例を実行するには、次のコードを Windows フォームに貼り付けます。フォームの Paint イベントを処理し、ShowOutputChannels を呼び出し、e を PaintEventArgs 値として渡します。

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

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

}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ImageAttributes クラス
ImageAttributes メンバ
System.Drawing.Imaging 名前空間

ImageAttributes.SetOutputChannel メソッド (ColorChannelFlag)

既定のカテゴリの CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。

名前空間: System.Drawing.Imaging
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub SetOutputChannel ( _
    flags As ColorChannelFlag _
)
Dim instance As ImageAttributes
Dim flags As ColorChannelFlag

instance.SetOutputChannel(flags)
public void SetOutputChannel (
    ColorChannelFlag flags
)
public:
void SetOutputChannel (
    ColorChannelFlag flags
)
public void SetOutputChannel (
    ColorChannelFlag flags
)
public function SetOutputChannel (
    flags : ColorChannelFlag
)

パラメータ

flags

出力チャネルを指定する ColorChannelFlag の要素。

戻り値
このメソッドは値を返しません。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ImageAttributes クラス
ImageAttributes メンバ
System.Drawing.Imaging 名前空間

ImageAttributes.SetOutputChannel メソッド

CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
ImageAttributes.SetOutputChannel (ColorChannelFlag) 既定のカテゴリの CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。
ImageAttributes.SetOutputChannel (ColorChannelFlag, ColorAdjustType) 指定されたカテゴリの CMYK (水色、マゼンタ、黄、黒) 出力チャネルを設定します。
参照参照

関連項目

ImageAttributes クラス
ImageAttributes メンバ
System.Drawing.Imaging 名前空間



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「ImageAttributes.SetOutputChannel」の関連用語

ImageAttributes.SetOutputChannelのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ImageAttributes.SetOutputChannelのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS