728x90
반응형
728x170
■ Shape 클래스의 Brush 속성을 사용해 브러시 이미지를 설정하는 방법을 보여준다.
▶ MainForm.cs
using System;
using System.Drawing;
using System.Windows.Forms;
using Steema.TeeChart.Drawing;
using Steema.TeeChart.Styles;
namespace TestProject
{
/// <summary>
/// 메인 폼
/// </summary>
public partial class MainForm : Form
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainForm()
/// <summary>
/// 생성자
/// </summary>
public MainForm()
{
InitializeComponent();
Text = "Shape 클래스 : Brush 속성을 사용해 브러시 이미지 설정하기";
this.tChart.Panel.Pen = new ChartPen(Color.Black);
Steema.TeeChart.Styles.Shape shape1 = new Steema.TeeChart.Styles.Shape(this.tChart.Chart);
shape1.Style = ShapeStyles.Circle;
shape1.FillSampleValues();
Steema.TeeChart.Styles.Shape shape2 = new Steema.TeeChart.Styles.Shape(this.tChart.Chart);
shape2.Style = ShapeStyles.Rectangle;
shape2.Brush.Image = Properties.Resources.texture;
shape2.Brush.Visible = true;
shape2.FillSampleValues();
this.transparentCheckBox.CheckedChanged += transparentCheckBox_CheckedChanged;
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Private
//////////////////////////////////////////////////////////////////////////////// Event
#region 투명 체크 박스 체크 변경시 처리하기 - transparentCheckBox_CheckedChanged(sender, e)
/// <summary>
/// 투명 체크 박스 체크 변경시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void transparentCheckBox_CheckedChanged(object sender, EventArgs e)
{
foreach(Steema.TeeChart.Styles.Shape shape in this.tChart.Series)
{
shape.Transparent = this.transparentCheckBox.Checked;
}
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
'TeeChart > WinForm' 카테고리의 다른 글
[TEECHART/WINFORM] TChart 클래스 : Axes 속성을 사용해 보조 그리드 표시하기 (0) | 2022.03.24 |
---|---|
[TEECHART/WINFORM] TChart 클래스 : Axes 속성을 사용해 축 최소/최대값 반올림하기 (0) | 2022.03.24 |
[TEECHART/WINFORM] TChart 클래스 : Axes 속성을 사용해 축 최소/최대 오프셋 설정하기 (0) | 2022.03.24 |
[TEECHART/WINFORM] TChart 클래스 : Axes 속성을 사용해 시리즈 앞에 축 그리기 (0) | 2022.03.24 |
[TEECHART/WINFORM] Shape 클래스 : VertAlignment 속성을 사용해 텍스트 정렬하기 (0) | 2022.03.24 |
[TEECHART/WINFORM] Shape 클래스 : Style 속성을 사용해 도형 추가하기 (0) | 2022.03.24 |
[TEECHART/WINFORM] Gantt 클래스 : Add/AddMultipleNextTasks 메소드 사용하기 (0) | 2022.03.24 |
[TEECHART/WINFORM] Gantt 클래스 사용하기 (0) | 2022.03.24 |
[TEECHART/WINFORM] Arrow 클래스 사용하기 (0) | 2022.03.24 |
[TEECHART/WINFORM] Points 클래스 : GetVertAxis 필드를 사용해 Y축 설정하기 (0) | 2022.03.24 |
댓글을 달아 주세요