ImageAttributes.SetThreshold メソッドとは? わかりやすく解説

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

ImageAttributes.SetThreshold メソッド (Single)

既定カテゴリしきい値 (透明度範囲) を指定します

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

Public Sub SetThreshold ( _
    threshold As Single _
)
Dim instance As ImageAttributes
Dim threshold As Single

instance.SetThreshold(threshold)
public void SetThreshold (
    float threshold
)
public:
void SetThreshold (
    float threshold
)
public void SetThreshold (
    float threshold
)

パラメータ

threshold

しきい値指定する実数

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

解説解説
使用例使用例

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

  1. Image開き、それを画面描画ます。

  2. ImageAttributes オブジェクト作成し、SetThreshold メソッド使用して、そのオブジェクトしきい値設定します

  3. ImageAttributes オブジェクトしきい値使用してイメージ画面描画ます。

Public Sub SetThresholdExample(ByVal
 e As PaintEventArgs)

    ' Open an Image file, and draw it to the screen.
    Dim myImage As Image = Image.FromFile("Camera.jpg")
    e.Graphics.DrawImage(myImage, 20, 20)

    ' Create an ImageAttributes object, and set its color threshold.
    Dim imageAttr As New
 ImageAttributes
    imageAttr.SetThreshold(0.7F)

    ' Draw the image with the colors bifurcated.
    Dim rect As New Rectangle(300,
 20, 200, 200)
    e.Graphics.DrawImage(myImage, rect, 0, 0, 200, 200, _
    GraphicsUnit.Pixel, imageAttr)
End Sub
private void SetThresholdExample(PaintEventArgs
 e)
{
             
    // Open an Image file, and draw it to the screen.
    Image myImage = Image.FromFile("Camera.jpg");
    e.Graphics.DrawImage(myImage, 20, 20);
             
    // Create an ImageAttributes object, and set its color threshold.
    ImageAttributes imageAttr = new ImageAttributes();
    imageAttr.SetThreshold(0.7f);
             
    // Draw the image with the colors bifurcated.
    Rectangle rect = new Rectangle(300, 20, 200, 200);
    e.Graphics.DrawImage(myImage, rect, 0, 0, 200, 200, 
        GraphicsUnit.Pixel, imageAttr);    
}
void SetThresholdExample( PaintEventArgs^ e )
{
   // Open an Image file, and draw it to the screen.
   Image^ myImage = Image::FromFile( "Camera.jpg" );
   e->Graphics->DrawImage( myImage, 20, 20 );

   // Create an ImageAttributes object, and set its color threshold.
   ImageAttributes^ imageAttr = gcnew ImageAttributes;
   imageAttr->SetThreshold( 0.7f );

   // Draw the image with the colors bifurcated.
   Rectangle rect = Rectangle(300,20,200,200);
   e->Graphics->DrawImage( myImage, rect, 0, 0, 200, 200, GraphicsUnit::Pixel,
 imageAttr );
}
private void SetThresholdExample(PaintEventArgs
 e)
{
    // Open an Image file, and draw it to the screen.
    Image myImage = Image.FromFile("Camera.jpg");

    e.get_Graphics().DrawImage(myImage, 20, 20);

    // Create an ImageAttributes object, and set its color threshold.
    ImageAttributes imageAttr = new ImageAttributes();

    imageAttr.SetThreshold(0.7F);

    // Draw the image with the colors bifurcated.
    Rectangle rect = new Rectangle(300, 20, 200, 200);

    e.get_Graphics().DrawImage(myImage, rect, 0, 0, 200, 200, 
        GraphicsUnit.Pixel, imageAttr);
} //SetThresholdExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ImageAttributes クラス
ImageAttributes メンバ
System.Drawing.Imaging 名前空間

ImageAttributes.SetThreshold メソッド (Single, ColorAdjustType)

指定したカテゴリしきい値 (透明度範囲) を設定します

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

Public Sub SetThreshold ( _
    threshold As Single, _
    type As ColorAdjustType _
)
Dim instance As ImageAttributes
Dim threshold As Single
Dim type As ColorAdjustType

instance.SetThreshold(threshold, type)
public void SetThreshold (
    float threshold,
    ColorAdjustType type
)
public:
void SetThreshold (
    float threshold, 
    ColorAdjustType type
)
public void SetThreshold (
    float threshold, 
    ColorAdjustType type
)
public function SetThreshold (
    threshold : float, 
    type : ColorAdjustType
)

パラメータ

threshold

最大値または最小値変換する色の並べ替えのためのブレークポイントとして使用される、0.0 ~ 1.0範囲内しきい値

type

色のしきい値設定する対象カテゴリ指定する ColorAdjustType の要素

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

解説解説

しきい値は、色の各要素カットオフ ポイント指定する 0 ~ 1 の範囲の値です。たとえば、しきい値が 0.7 に設定されているとき、赤、緑、青の要素それぞれ 23050、および 220 である色をレンダリングするとします。赤の要素230 で、0.7 × 255 より大きいため、255 (最大輝度) に変更されます。緑の要素50 で、0.7 × 255 より小さいため、緑の要素は 0 に変更されます。青の要素220 で、0.7 × 255 より大きいため、青の要素255変更されます。

ImageAttributes オブジェクトは、5 つ調整カテゴリ (既定ビットマップブラシペンテキスト) に関して色とグレースケール設定保持します。たとえば、既定カテゴリに対してしきい値指定しビットマップ カテゴリには別のしきい値指定し、さらにペン カテゴリにも異なしきい値指定できます

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

特定のカテゴリに対してカラー調整設定値またはグレースケール調整設定値指定すると、そのカテゴリ適用されていた既定調整設定値解除されます。たとえば、既定カテゴリに対して調整設定値コレクション指定するとしますPenSetThreshold メソッド渡してペン カテゴリしきい値設定すると、ペンには既定調整設定一切適用されません。

使用例使用例

コード例については、SetThreshold(Single) メソッドトピック参照してください

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

ImageAttributes.SetThreshold メソッド

しきい値 (透明度範囲) を設定します
オーバーロードの一覧オーバーロードの一覧

名前 説明
ImageAttributes.SetThreshold (Single) 既定カテゴリしきい値 (透明度範囲) を指定します
ImageAttributes.SetThreshold (Single, ColorAdjustType) 指定したカテゴリしきい値 (透明度範囲) を設定します
参照参照

関連項目

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



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

辞書ショートカット

すべての辞書の索引

ImageAttributes.SetThreshold メソッドのお隣キーワード
検索ランキング

   

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



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

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

©2024 GRAS Group, Inc.RSS