private void FormMain_Load(object sender, EventArgs e) { CurrentFigure = 0; Templates = new List <CFigure>(); FigureNames = new List <string>(); Parameters = new int[8]; FiguresList = new CFiguresList(); DrawingPen = new Pen(Color.FromArgb(0, 0, 0), 1); DrawingBrush = new SolidBrush(Color.FromArgb(255, 255, 255)); Drawing = new Bitmap(PictureBoxDraw.Width, PictureBoxDraw.Height); Canvas = Graphics.FromImage(Drawing); Templates.Add(CRectangle.CreateTemplate()); FigureNames.Add("Прямоугольник"); Templates.Add(CEllipse.CreateTemplate()); FigureNames.Add("Эллипс"); Templates.Add(CLine.CreateTemplate()); FigureNames.Add("Линия"); Templates.Add(CTrapezium.CreateTemplate()); FigureNames.Add("Трапеция"); LabelCurrentFigure.Text = FigureNames[0]; PictureBoxDraw.Image = Drawing; }
public static CEllipse CreateTemplate() { int[] TempMas; TempMas = new int[8]; for (int i = 1; i < 8; i++) { TempMas[i] = 0; } CEllipse Temp = new CEllipse(TempMas); return(Temp); }
public override CFigure Create(int[] Parameters) { CEllipse Temp = new CEllipse(Parameters); return(Temp); }