남윤형

평행사변형을 만드는 클래스 생성

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace flowchart
{
class FigParallelogram : FigBase
{
// 생성자도 상속해서 사용.
public FigParallelogram(Point location, Size size) : base(location, size)
{
}
public override void Draw(Graphics g)
{
//평행사변형을 그리는 함수
using (Pen pen = new Pen(Color.Red, 1))
{
int x1, x2, x3, x4, y1, y2;
x1 = Location.X + 30;
x2 = Location.X + Size.Width;
x3 = Location.X ;
x4 = Location.X + 70;
y1 = Location.Y;
y2 = Location.Y + Size.Height;
g.DrawLine(pen, x1, y1, x3, y2);
g.DrawLine(pen, x3, y2, x4, y2);
g.DrawLine(pen, x4, y2, x2, y1);
g.DrawLine(pen, x2, y1, x1, y1);
}
base.Draw(g);
}
}
}