첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
using System.Windows;
using System.Windows.Controls;

#region 선 도형 추가하기 - AddLine(canvas, strokeBrush, strokeThickness, x1, y1, x2, y2)

/// <summary>
/// 선 도형 추가하기
/// </summary>
/// <param name="canvas">캔버스</param>
/// <param name="strokeBrush">스트로크 브로시</param>
/// <param name="strokeThickness">스트로크 두께</param>
/// <param name="x1">X1</param>
/// <param name="y1">Y1</param>
/// <param name="x2">X2</param>
/// <param name="y2">Y2</param>
/// <returns>타원 도형</returns>
public Line AddLine(Canvas canvas, Brush strokeBrush, double strokeThickness, double x1, double y1, double x2, double y2)
{
    Line line = new Line();

    Canvas.SetLeft(line, 0);
    Canvas.SetTop (line, 0);

    line.X1 = x1;
    line.Y1 = y1;
    line.X2 = x2;
    line.Y2 = y2;

    line.Stroke          = strokeBrush;
    line.StrokeThickness = strokeThickness;

    canvas.Children.Add(line);

    return line;
}

#endregion
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요