示例#1
0
        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;
        }
示例#2
0
        public static CTrapezium CreateTemplate()
        {
            int[] TempMas;
            TempMas = new int[8];

            for (int i = 1; i < 8; i++)
            {
                TempMas[i] = 0;
            }

            CTrapezium Temp = new CTrapezium(TempMas);

            return(Temp);
        }
示例#3
0
        public override CFigure Create(int[] Parameters)
        {
            CTrapezium Temp = new CTrapezium(Parameters);

            return(Temp);
        }