LinearGradientBrush.SetSigmaBellShape Método

Definição

Cria uma queda de gradiente com base em uma curva em forma de sino.

Sobrecargas

SetSigmaBellShape(Single)

Cria uma queda de gradiente com base em uma curva em forma de sino.

SetSigmaBellShape(Single, Single)

Cria uma queda de gradiente com base em uma curva em forma de sino.

SetSigmaBellShape(Single)

Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs

Cria uma queda de gradiente com base em uma curva em forma de sino.

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

Parâmetros

focus
Single

Um valor de 0 a 1 que especifica o centro do gradiente (o ponto em que a cor inicial e cor final são mescladas igualmente).

Exemplos

Para obter um exemplo, consulte SetSigmaBellShape.

Comentários

Esse método especifica um focus, que é o ponto em que o gradiente é composto apenas pela cor final. O focus parâmetro representa um local como uma proporção da distância ao longo da linha de gradiente. O gradiente cai para a cor inicial com base em uma forma de curva de sino (distribuição normal) para ambos os lados.

Aplica-se a

SetSigmaBellShape(Single, Single)

Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs
Origem:
LinearGradientBrush.cs

Cria uma queda de gradiente com base em uma curva em forma de sino.

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)

Parâmetros

focus
Single

Um valor entre 0 e 1 que especifica o centro do gradiente (o ponto em que o gradiente é composto apenas pela cor final).

scale
Single

Um valor de 0 a 1 que especifica a rapidez com da redução das cores do focus.

Exemplos

O exemplo de código a seguir foi projetado para uso com Windows Forms e requer PaintEventArgse, um OnPaint objeto de evento. O código executa as seguintes ações:

  • Cria um novo LinearGradientBrush.

  • Usa esse pincel para desenhar uma elipse para a tela que tem uma transição linear da esquerda para a direita de cores.

  • Transforma o LinearGradientBrush para ter uma curva em forma de sino com seu pico no centro.

  • Desenha uma segunda elipse na tela usando o pincel em forma de sino.

Observe que o gradiente da elipse inferior faz a transição de azul para vermelho e, em seguida, volta para azul.

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

Comentários

Esse método especifica um focus, que é o ponto em que o gradiente é composto apenas pela cor final. O focus parâmetro representa um local como uma proporção da distância ao longo da linha de gradiente. O gradiente cai para a cor inicial com base em uma forma de curva de sino (distribuição normal) para ambos os lados.

Aplica-se a