첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

■ Gradient 클래스 : Gradient 객체 생성하기 예제

------------------------------------------------------------------------------------------------------------------------

using System.Drawing;

using System.Drawing.Drawing2D;

 

using Steema.TeeChart.Drawing;

 

Gradient gradient = CreateGradient(LinearGradientMode.ForwardDiagonal, true, Color.Red, Color.White, Color.Blue, 50);

------------------------------------------------------------------------------------------------------------------------

 

■ Gradient 클래스 : Gradient 객체 생성하기

------------------------------------------------------------------------------------------------------------------------

using System.Drawing;

using System.Drawing.Drawing2D;

 

using Steema.TeeChart.Drawing;

 

#region Gradient 객체 생성하기 - CreateGradient(linearGradientMode, useMiddleColor, startColor, middleColor, endColor, transparency)

 

/// <summary>

/// Gradient 객체 생성하기

/// </summary>

/// <param name="linearGradientMode">LinearGradientMode 객체</param>

/// <param name="useMiddleColor">중간 색상 사용 여부</param>

/// <param name="startColor">시작 색상</param>

/// <param name="middleColor">중간 색상</param>

/// <param name="endColor">종료 색상</param>

/// <param name="transparency">투명도</param>

/// <returns>Gradient 객체</returns>

public Gradient CreateGradient(LinearGradientMode linearGradientMode, bool useMiddleColor, Color startColor, Color middleColor, Color endColor, int transparency)

{

    Gradient gradient = new Gradient();

 

    gradient.Visible      = true;

    gradient.Direction    = linearGradientMode;

    gradient.UseMiddle    = useMiddleColor;

    gradient.StartColor   = startColor;

 

    if(gradient.UseMiddle)

    {

        gradient.MiddleColor = middleColor;

    }

 

    gradient.EndColor     = endColor;

    gradient.Transparency = transparency;

 

    return gradient;

}

 

#endregion

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요