Share via


LinearGradientBrush.SetSigmaBellShape メソッド

定義

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

オーバーロード

SetSigmaBellShape(Single)

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

SetSigmaBellShape(Single, Single)

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

SetSigmaBellShape(Single)

ソース:
LinearGradientBrush.cs
ソース:
LinearGradientBrush.cs
ソース:
LinearGradientBrush.cs

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

public:
 void SetSigmaBellShape(float focus);
public void SetSigmaBellShape (float focus);
member this.SetSigmaBellShape : single -> unit
Public Sub SetSigmaBellShape (focus As Single)

パラメーター

focus
Single

グラデーションの中央 (開始色と終了色が同量ずつブレンドされる点) を指定する 0 から 1 の値。

例については、次を参照してください。 SetSigmaBellShape.

注釈

このメソッドは、 を focus指定します。これは、グラデーションが終了色のみで構成されるポイントです。 パラメーターは focus 、グラデーション線に沿った距離の割合として位置を表します。 グラデーションは、ベル曲線の形状 (正規分布) に基づいて、どちらの側にも開始色に落ちます。

適用対象

SetSigmaBellShape(Single, Single)

ソース:
LinearGradientBrush.cs
ソース:
LinearGradientBrush.cs
ソース:
LinearGradientBrush.cs

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

public:
 void SetSigmaBellShape(float focus, float scale);
public void SetSigmaBellShape (float focus, float scale);
member this.SetSigmaBellShape : single * single -> unit
Public Sub SetSigmaBellShape (focus As Single, scale As Single)

パラメーター

focus
Single

グラデーションの中心 (グラデーションの終了色だけで構成される点) を指定する 0 から 1 の値。

scale
Single

色が focus に向かって変化する度合いを指定する 0 ~ 1 の値。

次のコード例は、Windows フォームで使用するように設計されており、イベント オブジェクトがOnPaint必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • 新しい LinearGradientBrush を作成します。

  • このブラシを使用して、色の直線的な左から右への遷移を持つ画面に楕円を描画します。

  • LinearGradientBrush 変換して、中心にピークがあるベル形の曲線を作成します。

  • ベル型ブラシを使用して、画面に 2 番目の楕円を描画します。

下の楕円のグラデーションが青から赤に遷移し、青色に戻ります。

private:
   void SetSigmaBellShapeExample( PaintEventArgs^ e )
   {
      // Create a LinearGradientBrush.
      Rectangle myRect = Rectangle(20,20,200,100);
      LinearGradientBrush^ myLGBrush = gcnew 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 );
   }
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);
}
Public Sub SetSigmaBellShapeExample(ByVal 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, 0.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, 1.0F)

    ' Use the triangular brush to draw a second ellipse.
    myRect.Y = 150
    e.Graphics.FillEllipse(myLGBrush, myRect)
End Sub

注釈

このメソッドは、 を focus指定します。これは、グラデーションが終了色のみで構成されるポイントです。 パラメーターは focus 、グラデーション線に沿った距離の割合として位置を表します。 グラデーションは、ベル曲線の形状 (正規分布) に基づいて、どちらの側にも開始色に落ちます。

適用対象