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 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ImageAttributes.SetNoOp」の関連用語

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

   

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



ImageAttributes.SetNoOpのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS