Blend Construtores
Definição
Sobrecargas
| Blend() |
Inicializa uma nova instância da classe Blend.Initializes a new instance of the Blend class. |
| Blend(Int32) |
Inicializa uma nova instância da classe Blend com o número especificado de fatores e posições.Initializes a new instance of the Blend class with the specified number of factors and positions. |
Blend()
public:
Blend();
public Blend ();
Public Sub New ()
Exemplos
O exemplo a seguir destina-se a ser usado em um ambiente de Windows Forms.The following example is intended to be used in a Windows Forms environment. Ele demonstra como usar a Blend classe em conjunto com a LinearGradientBrush classe para desenhar uma elipse na tela que tem suas cores misturadas.It demonstrates how to use the Blend class in conjunction with the LinearGradientBrush class to draw an ellipse to screen that has its colors blended. A elipse está azul à esquerda, mistura para vermelho no centro e mescla de volta para azul à direita.The ellipse is blue on the left, blends to red in the center, and blends back to blue on the right. Isso é feito por meio das configurações nas myFactors myPositions matrizes e usadas nas Factors Positions Propriedades e.This is accomplished through the settings in the myFactors and myPositions arrays used in the Factors and Positions properties. Observe que a Blend Propriedade do LinearGradientBrush objeto chamado lgBrush2 deve ser feita igual ao Blend objeto myBlend .Note that the Blend property of the LinearGradientBrush object named lgBrush2 must be made equal to the Blend object myBlend.
public:
void BlendConstExample( PaintEventArgs^ e )
{
//Draw ellipse using Blend.
Point startPoint2 = Point(20,110);
Point endPoint2 = Point(140,110);
array<Single>^myFactors = {.2f,.4f,.8f,.8f,.4f,.2f};
array<Single>^myPositions = {0.0f,.2f,.4f,.6f,.8f,1.0f};
Blend^ myBlend = gcnew Blend;
myBlend->Factors = myFactors;
myBlend->Positions = myPositions;
LinearGradientBrush^ lgBrush2 =
gcnew LinearGradientBrush( startPoint2,endPoint2,Color::Blue,Color::Red );
lgBrush2->Blend = myBlend;
Rectangle ellipseRect2 = Rectangle(20,110,120,80);
e->Graphics->FillEllipse( lgBrush2, ellipseRect2 );
// End example.
}
public void BlendConstExample(PaintEventArgs e)
{
//Draw ellipse using Blend.
Point startPoint2 = new Point(20, 110);
Point endPoint2 = new Point(140, 110);
float[] myFactors = {.2f,.4f,.8f,.8f,.4f,.2f};
float[] myPositions = {0.0f,.2f,.4f,.6f,.8f,1.0f};
Blend myBlend = new Blend();
myBlend.Factors = myFactors;
myBlend.Positions = myPositions;
LinearGradientBrush lgBrush2 = new LinearGradientBrush(
startPoint2,
endPoint2,
Color.Blue,
Color.Red);
lgBrush2.Blend = myBlend;
Rectangle ellipseRect2 = new Rectangle(20, 110, 120, 80);
e.Graphics.FillEllipse(lgBrush2, ellipseRect2);
// End example.
}
Public Sub BlendConstExample(ByVal e As PaintEventArgs)
' Draw ellipse using Blend.
Dim startPoint2 As New Point(20, 110)
Dim endPoint2 As New Point(140, 110)
Dim myFactors As Single() = {0.2F, 0.4F, 0.8F, 0.8F, 0.4F, 0.2F}
Dim myPositions As Single() = {0.0F, 0.2F, 0.4F, 0.6F, 0.8F, 1.0F}
Dim myBlend As New Blend
myBlend.Factors = myFactors
myBlend.Positions = myPositions
Dim lgBrush2 As New LinearGradientBrush(startPoint2, endPoint2, _
Color.Blue, Color.Red)
lgBrush2.Blend = myBlend
Dim ellipseRect2 As New Rectangle(20, 110, 120, 80)
e.Graphics.FillEllipse(lgBrush2, ellipseRect2)
End Sub
Aplica-se a
Blend(Int32)
public:
Blend(int count);
public Blend (int count);
new System.Drawing.Drawing2D.Blend : int -> System.Drawing.Drawing2D.Blend
Public Sub New (count As Integer)
Parâmetros
- count
- Int32
O número de elementos nas matrizes Factors e Positions.The number of elements in the Factors and Positions arrays.
Exemplos
Para ver um exemplo, consulte Blend.For an example, see Blend.