次の方法で共有


LinearGradientBrush.SetSigmaBellShape メソッド

釣鐘型の曲線に基づいて、グラデーションの減色を作成します。

オーバーロードの一覧

釣鐘型の曲線に基づいて、グラデーションの減色を作成します。

[Visual Basic] Overloads Public Sub SetSigmaBellShape(Single)

[C#] public void SetSigmaBellShape(float);

[C++] public: void SetSigmaBellShape(float);

[JScript] public function SetSigmaBellShape(float);

釣鐘型の曲線に基づいて、グラデーションの減色を作成します。

[Visual Basic] Overloads Public Sub SetSigmaBellShape(Single, Single)

[C#] public void SetSigmaBellShape(float, float);

[C++] public: void SetSigmaBellShape(float, float);

[JScript] public function SetSigmaBellShape(float, float);

使用例

[Visual Basic, C#] 次の例は、Windows フォームでの使用を意図してデザインされており、 OnPaint イベントのオブジェクトである PaintEventArgs e が必要です。このコードは次のアクションを実行します。

  • 新しい LinearGradientBrush オブジェクトを作成します。
  • このブラシを使用して、左から右へ線形に色が変化するグラデーションを持つ楕円を画面に描画します。
  • LinearGradientBrush オブジェクトを、中央に頂点のある釣鐘型曲線に変換します。
  • 釣鐘型のブラシを使用して、画面に 2 番目の楕円を描画します。

[Visual Basic, C#] 下の楕円のグラデーションは、青から赤に変化し、さらに青に戻ります。

[Visual Basic, C#] メモ   ここでは、SetSigmaBellShape のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。

 
Public Sub SetSigmaBellShapeExample(e As PaintEventArgs)
' Create a LinearGradientBrush.
Dim myRect As New Rectangle(20, 20, 200, 100)
Dim myLGBrush As New LinearGradientBrush(myRect, Color.Blue, _
Color.Red, 0F, True)
' Draw an ellipse to the screen using the LinearGradientBrush.
e.Graphics.FillEllipse(myLGBrush, myRect)
' Create a triangular shaped brush with the peak at the center
' of the drawing area.
myLGBrush.SetSigmaBellShape(0.5F, 1F)
' Use the triangular brush to draw a second ellipse.
myRect.Y = 150
e.Graphics.FillEllipse(myLGBrush, myRect)
End Sub
        
[C#] 
private void SetSigmaBellShapeExample(PaintEventArgs e)
{
// Create a LinearGradientBrush.
Rectangle myRect = new Rectangle(20, 20, 200, 100);
LinearGradientBrush myLGBrush = new LinearGradientBrush(
myRect,
Color.Blue,
Color.Red,
0.0f,
true);
// Draw an ellipse to the screen using the LinearGradientBrush.
e.Graphics.FillEllipse(myLGBrush, myRect);
// Create a bell-shaped brush with the peak at the
// center of the drawing area.
myLGBrush.SetSigmaBellShape(.5f, 1.0f);
// Use the bell- shaped brush to draw a second
// ellipse.
myRect.Y = 150;
e.Graphics.FillEllipse(myLGBrush, myRect);
}
        

[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

参照

LinearGradientBrush クラス | LinearGradientBrush メンバ | System.Drawing.Drawing2D 名前空間