Blend 클래스

정의

LinearGradientBrush 개체의 혼합 패턴을 정의합니다. 이 클래스는 상속될 수 없습니다.

public ref class Blend sealed
public sealed class Blend
type Blend = class
Public NotInheritable Class Blend
상속
Blend

예제

다음 예제는 Windows Forms 환경에서 사용하기 위한 것입니다. 클래스와 함께 LinearGradientBrush 클래스를 사용하여 Blend 색이 혼합된 화면에 타원을 그리는 방법을 보여 줍니다. 타원은 왼쪽에 파란색, 중앙에 빨간색으로 혼합, 오른쪽에 파란색으로 다시 혼합. 이 작업은 속성 및 속성에 myFactors 사용되는 배열 및 myPositions 설정에 Factors Positions 따라 수행됩니다. 명명 lgBrush2Blend 개체의 속성은 LinearGradientBrush 개체myBlendBlend 같아야 합니다.

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

설명

그라데이션은 일반적으로 셰이프의 내부를 부드럽게 음영하는 데 사용됩니다. 혼합 패턴은 각각 동일한 수의 요소를 포함하는 두 배열(FactorsPositions)로 정의됩니다. 배열의 Positions 각 요소는 그라데이션 선을 따라 거리의 비율을 나타냅니다. 배열의 Factors 각 요소는 배열의 해당 요소가 나타내는 그라데이션 선을 따라 있는 위치에 있는 그라데이션 블렌드에서 Positions 시작 및 끝 색의 비율을 나타냅니다.

예를 들어 배열의 Factors 해당 요소가 Positions 각각 0.2와 0.3인 경우 100픽셀 선을 따라 파란색에서 빨간색으로 선형 그라데이션의 경우 해당 선의 20픽셀(거리의 20%)은 30%의 파란색과 70%의 빨간색으로 구성됩니다.

생성자

Blend()

Blend 클래스의 새 인스턴스를 초기화합니다.

Blend(Int32)

지정된 비율과 위치의 수를 사용하여 Blend 클래스의 새 인스턴스를 초기화합니다.

속성

Factors

그라데이션을 위한 혼합 비율의 배열을 가져오거나 설정합니다.

Positions

그라데이션을 위한 혼합 위치의 배열을 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상