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

ImageAttributes.SetNoOp メソッド ()

既定のカテゴリのカラー調整をオフにします。ClearNoOp メソッドを呼び出して、SetNoOp メソッドを呼び出す前のカラー調整設定に戻すことができます。

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

Dim instance As ImageAttributes

instance.SetNoOp
public void SetNoOp ()
public:
void SetNoOp ()
public void SetNoOp ()
解説解説
使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

  1. ファイル Camera.jpg を使用する Image を開きます。

  2. ImageAttributes オブジェクトのガンマ値を 0.25 に設定します。

  3. 画面にイメージを描画します。

  4. SetNoOp メソッドを呼び出します。

  5. イメージ (2 回目のカメラ) を画面に描画しますが、SetNoOp メソッドが呼び出されていたため、ガンマ設定は既定値の 1.0 に設定され、既定のガンマ設定でイメージが画面に描画されます。

左側のイメージは強く色あせ (ガンマ 0.25)、右側のイメージの方がコントラストが大きくなっている (ガンマ 1.0) ことに注意してください。

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
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);    
}
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.get_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.get_Graphics().DrawImage(myImage, rect2, 0, 0, 200, 200, 
        GraphicsUnit.Pixel, imageAttr);
} //SetNoOpExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ImageAttributes クラス
ImageAttributes メンバ
System.Drawing.Imaging 名前空間

ImageAttributes.SetNoOp メソッド (ColorAdjustType)

指定したカテゴリのカラー調整をオフにします。ClearNoOp メソッドを呼び出して、SetNoOp メソッドを呼び出す前のカラー調整設定に戻すことができます。

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

Public Sub SetNoOp ( _
    type As ColorAdjustType _
)
Dim instance As ImageAttributes
Dim type As ColorAdjustType

instance.SetNoOp(type)
public void SetNoOp (
    ColorAdjustType type
)
public:
void SetNoOp (
    ColorAdjustType type
)
public void SetNoOp (
    ColorAdjustType type
)
public function SetNoOp (
    type : ColorAdjustType
)

パラメータ

type

色補正をオフにする対象のカテゴリを指定する ColorAdjustType の要素。

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

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

ImageAttributes.SetNoOp メソッド

カラー調整をオフにします。
オーバーロードの一覧オーバーロードの一覧

名前 説明
ImageAttributes.SetNoOp () 既定のカテゴリのカラー調整をオフにします。ClearNoOp メソッドを呼び出して、SetNoOp メソッドを呼び出す前のカラー調整設定に戻すことができます。
ImageAttributes.SetNoOp (ColorAdjustType) 指定したカテゴリのカラー調整をオフにします。ClearNoOp メソッドを呼び出して、SetNoOp メソッドを呼び出す前のカラー調整設定に戻すことができます。
参照参照

関連項目

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



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「ImageAttributes.SetNoOp」の関連用語

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

   

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



ImageAttributes.SetNoOpのページの著作権

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

©2026 GRAS Group, Inc.RSS