ImageAttributes.SetNoOp 메서드

정의

색 조정을 해제합니다.

오버로드

SetNoOp()

기본 범주에 대한 색 조정을 해제합니다. SetNoOp 메서드를 호출하기 전의 상태로 색 조정 설정을 복구하려면 ClearNoOp 메서드를 호출합니다.

SetNoOp(ColorAdjustType)

지정된 범주에 대한 색 조정을 해제합니다. SetNoOp 메서드를 호출하기 전의 상태로 색 조정 설정을 복구하려면 ClearNoOp 메서드를 호출합니다.

SetNoOp()

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

기본 범주에 대한 색 조정을 해제합니다. SetNoOp 메서드를 호출하기 전의 상태로 색 조정 설정을 복구하려면 ClearNoOp 메서드를 호출합니다.

public:
 void SetNoOp();
public void SetNoOp ();
member this.SetNoOp : unit -> unit
Public Sub SetNoOp ()

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  1. Image 파일 Camera.jpg 사용하는 를 엽니다.

  2. 개체의 ImageAttributes 감마 값을 0.25로 설정합니다.

  3. 이미지를 화면에 그립니다.

  4. SetNoOp 메서드를 호출합니다.

  5. 이미지(두 번째 카메라)를 화면에 그립니다. 그러나 메서드가 SetNoOp 호출되었으므로 감마 설정은 기본적으로 1.0 값으로 설정되고 이미지는 기본 감마 설정으로 화면에 그려집니다.

왼쪽의 이미지는 매우 씻겨 나가고(감마 0.25) 오른쪽의 이미지 대비가 더 높습니다(감마 1.0).

private:
   void SetNoOpExample( PaintEventArgs^ e )
   {
      // Create an Image object from the file Camera.jpg.
      Image^ myImage = Image::FromFile( "Camera.jpg" );

      // Create an ImageAttributes object, and set the gamma to 0.25.
      ImageAttributes^ imageAttr = gcnew ImageAttributes;
      imageAttr->SetGamma( 0.25f );

      // Draw the image with gamma set to 0.25.
      Rectangle rect1 = Rectangle(20,20,200,200);
      e->Graphics->DrawImage( myImage, rect1, 0, 0, 200, 200, GraphicsUnit::Pixel, imageAttr );

      // Call the ImageAttributes NoOp method.
      imageAttr->SetNoOp();

      // Draw the image after NoOp is set, so the default gamma value
      // of 1.0 will be used.
      Rectangle rect2 = Rectangle(250,20,200,200);
      e->Graphics->DrawImage( myImage, rect2, 0, 0, 200, 200, GraphicsUnit::Pixel, imageAttr );
   }
private void SetNoOpExample(PaintEventArgs e)
{
             
    // Create an Image object from the file Camera.jpg.
    Image myImage = Image.FromFile("Camera.jpg");
             
    // Create an ImageAttributes object, and set the gamma to 0.25.
    ImageAttributes imageAttr = new ImageAttributes();
    imageAttr.SetGamma(0.25f);
             
    // Draw the image with gamma set to 0.25.
    Rectangle rect1 = new Rectangle(20, 20, 200, 200);
    e.Graphics.DrawImage(myImage, rect1, 0, 0, 200, 200, 
        GraphicsUnit.Pixel, imageAttr);    
    
    // Call the ImageAttributes NoOp method.
    imageAttr.SetNoOp();
             
    // Draw the image after NoOp is set, so the default gamma value
    // of 1.0 will be used.
    Rectangle rect2 = new Rectangle(250, 20, 200, 200);
    e.Graphics.DrawImage(myImage, rect2, 0, 0, 200, 200, 
        GraphicsUnit.Pixel, imageAttr);    
}
Public Sub SetNoOpExample(ByVal e As PaintEventArgs)

    ' Create an Image object from the file Camera.jpg.
    Dim myImage As Image = Image.FromFile("Camera.jpg")

    ' Create an ImageAttributes object, and set the gamma to 0.25.
    Dim imageAttr As New ImageAttributes
    imageAttr.SetGamma(0.25F)

    ' Draw the image with gamma set to 0.25.
    Dim rect1 As New Rectangle(20, 20, 200, 200)
    e.Graphics.DrawImage(myImage, rect1, 0, 0, 200, 200, _
    GraphicsUnit.Pixel, imageAttr)

    ' Call the ImageAttributes NoOp method.
    imageAttr.SetNoOp()

    ' Draw the image with gamma set to 0.25, but now NoOp is set,    
    ' so the uncorrected image will be shown.
    Dim rect2 As New Rectangle(250, 20, 200, 200)
    e.Graphics.DrawImage(myImage, rect2, 0, 0, 200, 200, _
    GraphicsUnit.Pixel, imageAttr)
    ' Image
End Sub

설명

개체는 ImageAttributes 기본, 비트맵, 브러시, 펜 및 텍스트의 다섯 가지 조정 범주에 대해 색 및 회색조 설정을 유지합니다. 예를 들어 기본 범주의 감마 값, 비트맵 범주의 다른 감마 값, 펜 범주에 대해 여전히 다른 감마 값을 지정할 수 있습니다.

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

적용 대상

SetNoOp(ColorAdjustType)

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

지정된 범주에 대한 색 조정을 해제합니다. SetNoOp 메서드를 호출하기 전의 상태로 색 조정 설정을 복구하려면 ClearNoOp 메서드를 호출합니다.

public:
 void SetNoOp(System::Drawing::Imaging::ColorAdjustType type);
public void SetNoOp (System.Drawing.Imaging.ColorAdjustType type);
member this.SetNoOp : System.Drawing.Imaging.ColorAdjustType -> unit
Public Sub SetNoOp (type As ColorAdjustType)

매개 변수

type
ColorAdjustType

색 보정 기능이 해제되는 범주를 지정하는 ColorAdjustType의 요소입니다.

예제

코드 예제는 메서드를 참조하세요 SetNoOp() .

설명

개체는 ImageAttributes 기본, 비트맵, 브러시, 펜 및 텍스트의 다섯 가지 조정 범주에 대해 색 및 회색조 설정을 유지합니다. 예를 들어 기본 범주의 감마 값, 비트맵 범주의 다른 감마 값, 펜 범주에 대해 여전히 다른 감마 값을 지정할 수 있습니다.

적용 대상