ImageAttributes.SetOutputChannel 메서드

정의

CMYK(녹청, 자홍, 노랑, 검정) 출력 채널을 설정합니다.

오버로드

SetOutputChannel(ColorChannelFlag)

기본 범주에 대한 CMYK(녹청, 자홍, 노랑, 검정) 출력 채널을 설정합니다.

SetOutputChannel(ColorChannelFlag, ColorAdjustType)

지정된 범주에 대한 CMYK(녹청, 자홍, 노랑, 검정) 출력 채널을 설정합니다.

SetOutputChannel(ColorChannelFlag)

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

기본 범주에 대한 CMYK(녹청, 자홍, 노랑, 검정) 출력 채널을 설정합니다.

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의 요소입니다.

예제

다음 코드 예제에서는 SetOutputChannel 메서드를 사용하는 방법을 보여 줍니다. 이 예제를 실행 하려면 Windows 폼에 다음 코드를 붙여 넣습니다. 양식의 Paint 이벤트를 처리하고 를 로 전달 ePaintEventArgs하여 를 호출ShowOutputChannels합니다.

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 색 채널 중 하나의 강도를 검사할 수 있습니다. 예를 들어 개체를 ImageAttributes 만들고 해당 비트맵 출력 채널을 로 설정한다고 가정합니다 ColorChannelC. 해당 ImageAttributes 개체의 경로를 메서드에 DrawImage 전달하면 각 픽셀의 시안 구성 요소가 계산되고 렌더링된 이미지의 각 픽셀은 시안 채널의 강도를 나타내는 회색 음영입니다. 마찬가지로 자홍색, 노란색 및 검은색 채널의 강도를 나타내는 이미지를 렌더링할 수 있습니다.

개체는 ImageAttributes 기본, 비트맵, 브러시, 펜 및 텍스트의 다섯 가지 조정 범주에 대한 색 및 회색조 설정을 유지합니다. 예를 들어 기본 범주의 출력 채널과 비트맵 범주에 대해 다른 출력 채널을 지정할 수 있습니다.

기본 색 조정 및 회색조 조정 설정은 자체 조정 설정이 없는 모든 범주에 적용됩니다. 예를 들어 비트맵 범주에 대한 조정 설정을 지정하지 않으면 기본 설정이 비트맵 범주에 적용됩니다.

적용 대상

SetOutputChannel(ColorChannelFlag, ColorAdjustType)

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

지정된 범주에 대한 CMYK(녹청, 자홍, 노랑, 검정) 출력 채널을 설정합니다.

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의 요소입니다.

type
ColorAdjustType

출력 채널이 설정되는 범주를 지정하는 ColorAdjustType의 요소입니다.

예제

다음 코드 예제에서는 SetOutputChannel 메서드를 사용하는 방법을 보여 줍니다. 이 예제를 실행 하려면 Windows 폼에 다음 코드를 붙여 넣습니다. 양식의 Paint 이벤트를 처리하고 를 로 전달 ePaintEventArgs하여 를 호출ShowOutputChannels합니다.

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 색 채널 중 하나의 강도를 검사할 수 있습니다. 예를 들어 개체를 ImageAttributes 만들고 해당 비트맵 출력 채널을 로 설정한다고 가정합니다 ColorChannelC. 해당 ImageAttributes 개체의 경로를 메서드에 DrawImage 전달하면 각 픽셀의 시안 구성 요소가 계산되고 렌더링된 이미지의 각 픽셀은 시안 채널의 강도를 나타내는 회색 음영입니다. 마찬가지로 자홍색, 노란색 및 검은색 채널의 강도를 나타내는 이미지를 렌더링할 수 있습니다.

개체는 ImageAttributes 기본, 비트맵, 브러시, 펜 및 텍스트의 다섯 가지 조정 범주에 대한 색 및 회색조 설정을 유지합니다. 예를 들어 기본 범주의 출력 채널과 비트맵 범주에 대해 다른 출력 채널을 지정할 수 있습니다.

기본 색 조정 및 회색조 조정 설정은 자체 조정 설정이 없는 모든 범주에 적용됩니다. 예를 들어 비트맵 범주에 대한 조정 설정을 지정하지 않으면 기본 설정이 비트맵 범주에 적용됩니다.

특정 범주에 대한 색 조정 또는 회색조 조정 설정을 지정하는 즉시 기본 조정 설정이 해당 범주에 더 이상 적용되지 않습니다. 예를 들어 기본 범주에 대한 조정 설정 컬렉션을 지정한다고 가정합니다. 메서드에 전달 BitmapSetOutputChannel 하여 비트맵 범주에 대한 출력 채널을 설정하는 경우 비트맵에 기본 조정 설정이 적용되지 않습니다.

적용 대상