釣鐘型の曲線に基づいて、グラデーションの減色を作成します。
Overloads Public Sub SetSigmaBellShape( _
ByVal focus As Single, _ ByVal scale As Single _)
[C#]
public void SetSigmaBellShape(floatfocus,floatscale);
[C++]
public: void SetSigmaBellShape(floatfocus,floatscale);
[JScript]
public function SetSigmaBellShape(
focus : float,scale : float);
パラメータ
- focus
グラデーションの中心 (グラデーションの終了色だけで構成される点) を指定する 0 ~ 1 の値。 - scale
色が focus に向かって変化する度合いを指定する 0 ~ 1 の値。
解説
このメソッドは、グラデーションの中で終了色だけで構成されている点である focus を指定します。 focus パラメータは、グラデーション線に沿った距離の比率として位置を表します。釣鐘形曲線 (正規分布) に基づいて、両端で開始色に戻るグラデーションになります。
使用例
[Visual Basic, C#] 次の例は、Windows フォームでの使用を意図してデザインされており、 OnPaint イベントのオブジェクトである PaintEventArgs e が必要です。このコードは次のアクションを実行します。
- 新しい LinearGradientBrush オブジェクトを作成します。
- このブラシを使用して、左から右へ線形に色が変化するグラデーションを持つ楕円を画面に描画します。
- LinearGradientBrush オブジェクトを、中央に頂点のある釣鐘型曲線に変換します。
- 釣鐘型のブラシを使用して、画面に 2 番目の楕円を描画します。
[Visual Basic, C#] 下の楕円のグラデーションは、青から赤に変化し、さらに青に戻ります。
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# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
LinearGradientBrush クラス | LinearGradientBrush メンバ | System.Drawing.Drawing2D 名前空間 | LinearGradientBrush.SetSigmaBellShape オーバーロードの一覧